chore: upgrade to new Zone.js API v0.6.2

BREAKING CHANGE

Removed deprecated API from NgZone
- `NgZone.overrideOnTurnStart`
- `NgZone.overrideOnTurnDone`
- `NgZone.overrideOnEventDone`
- `NgZone.overrideOnErrorHandler`

Rename NgZone API
- `NgZone.onTurnStart` => `NgZone.onUnstable`
- `NgZone.onTurnDone` => `NgZone.onMicrotaskEmpty`
- `NgZone.onEventDone` => `NgZone.onStable`

Closes #7345
This commit is contained in:
Misko Hevery
2016-02-25 14:24:17 -08:00
committed by Miško Hevery
parent f9fb72fb0e
commit 310620fd12
42 changed files with 866 additions and 1826 deletions

View File

@ -1,14 +1,3 @@
// Zones are TC-39 standards-track so users could choose a different implementation
// Rather than import {Zone} from 'zone.js' we define an interface
// so that any library that structurally matches may be used with Angular 2.
export interface ZoneLike {
fork(locals?: any): ZoneLike;
run(fn: any, applyTo?: any, applyWith?: any): any;
}
export interface ZoneLikeConstructor {
longStackTraceZone: { [key: string]: any; };
}
export interface BrowserNodeGlobal {
Object: typeof Object;
Array: typeof Array;
@ -20,8 +9,7 @@ export interface BrowserNodeGlobal {
Math: any; // typeof Math;
assert(condition: any): void;
Reflect: any;
zone: ZoneLike;
Zone: ZoneLikeConstructor;
Zone: typeof Zone;
getAngularTestability: Function;
getAllAngularTestabilities: Function;
getAllAngularRootElements: Function;
@ -46,6 +34,10 @@ if (typeof window === 'undefined') {
globalScope = <any>window;
}
export function scheduleMicroTask(fn: Function) {
Zone.current.scheduleMicroTask('scheduleMicrotask', fn);
}
export const IS_DART = false;
// Need to declare a new variable for global here since TypeScript