From fb16c394965e210b0e1a656da3e2b261bc75c544 Mon Sep 17 00:00:00 2001 From: mlaval Date: Thu, 26 Nov 2015 19:38:14 +0100 Subject: [PATCH] chore(build): fix flakiness of the element probe global test --- modules/angular2/src/facade/lang.ts | 2 +- modules/angular2/src/platform/browser/tools/tools.ts | 2 +- .../src/platform/dom/debug/debug_element_view_listener.ts | 2 +- .../platform/browser/debug/debug_element_view_listener_spec.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/angular2/src/facade/lang.ts b/modules/angular2/src/facade/lang.ts index 70b9319679..08609f43f8 100644 --- a/modules/angular2/src/facade/lang.ts +++ b/modules/angular2/src/facade/lang.ts @@ -354,7 +354,7 @@ export function setValueOnPath(global: any, path: string, value: any) { var obj: any = global; while (parts.length > 1) { var name = parts.shift(); - if (obj.hasOwnProperty(name)) { + if (obj.hasOwnProperty(name) && isPresent(obj[name])) { obj = obj[name]; } else { obj = obj[name] = {}; diff --git a/modules/angular2/src/platform/browser/tools/tools.ts b/modules/angular2/src/platform/browser/tools/tools.ts index a3b607df19..d68d88aceb 100644 --- a/modules/angular2/src/platform/browser/tools/tools.ts +++ b/modules/angular2/src/platform/browser/tools/tools.ts @@ -23,5 +23,5 @@ export function enableDebugTools(ref: ComponentRef): void { * Disables Angular 2 tools. */ export function disableDebugTools(): void { - context.ng = undefined; + delete context.ng; } diff --git a/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts b/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts index bcf5670883..bee8c0bbf0 100644 --- a/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts +++ b/modules/angular2/src/platform/dom/debug/debug_element_view_listener.ts @@ -72,4 +72,4 @@ export const ELEMENT_PROBE_PROVIDERS: any[] = CONST_EXPR([ CONST_EXPR(new Provider(AppViewListener, {useExisting: DebugElementViewListener})), ]); -export const ELEMENT_PROBE_BINDINGS = ELEMENT_PROBE_PROVIDERS; \ No newline at end of file +export const ELEMENT_PROBE_BINDINGS = ELEMENT_PROBE_PROVIDERS; diff --git a/modules/angular2/test/platform/browser/debug/debug_element_view_listener_spec.ts b/modules/angular2/test/platform/browser/debug/debug_element_view_listener_spec.ts index e80975b081..5b6d09540e 100644 --- a/modules/angular2/test/platform/browser/debug/debug_element_view_listener_spec.ts +++ b/modules/angular2/test/platform/browser/debug/debug_element_view_listener_spec.ts @@ -68,7 +68,7 @@ export function main() { async.done(); }); - }), 10000); + }), 1000); } }); }