feat(zone): upgrade to zone.js@0.6.21
This commit is contained in:
parent
c9513b713a
commit
051a6ebe12
|
@ -9,7 +9,7 @@
|
|||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"rxjs": "5.0.0-beta.11",
|
||||
"zone.js": "^0.6.17"
|
||||
"zone.js": "^0.6.21"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
@ -35,62 +35,61 @@ export class NgZoneImpl {
|
|||
this.setMacrotask = setMacrotask;
|
||||
this.onError = onError;
|
||||
|
||||
if (Zone) {
|
||||
this.outer = this.inner = Zone.current;
|
||||
if ((Zone as any /** TODO #9100 */)['wtfZoneSpec']) {
|
||||
this.inner = this.inner.fork((Zone as any /** TODO #9100 */)['wtfZoneSpec']);
|
||||
}
|
||||
if (trace && (Zone as any /** TODO #9100 */)['longStackTraceZoneSpec']) {
|
||||
this.inner = this.inner.fork((Zone as any /** TODO #9100 */)['longStackTraceZoneSpec']);
|
||||
}
|
||||
this.inner = this.inner.fork({
|
||||
name: 'angular',
|
||||
properties: <any>{'isAngularZone': true},
|
||||
onInvokeTask: (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task,
|
||||
applyThis: any, applyArgs: any): any => {
|
||||
try {
|
||||
this.onEnter();
|
||||
return delegate.invokeTask(target, task, applyThis, applyArgs);
|
||||
} finally {
|
||||
this.onLeave();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onInvoke: (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function,
|
||||
applyThis: any, applyArgs: any[], source: string): any => {
|
||||
try {
|
||||
this.onEnter();
|
||||
return delegate.invoke(target, callback, applyThis, applyArgs, source);
|
||||
} finally {
|
||||
this.onLeave();
|
||||
}
|
||||
},
|
||||
|
||||
onHasTask:
|
||||
(delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {
|
||||
delegate.hasTask(target, hasTaskState);
|
||||
if (current == target) {
|
||||
// We are only interested in hasTask events which originate from our zone
|
||||
// (A child hasTask event is not interesting to us)
|
||||
if (hasTaskState.change == 'microTask') {
|
||||
this.setMicrotask(hasTaskState.microTask);
|
||||
} else if (hasTaskState.change == 'macroTask') {
|
||||
this.setMacrotask(hasTaskState.macroTask);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any):
|
||||
boolean => {
|
||||
delegate.handleError(target, error);
|
||||
this.onError(error);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
throw new Error('Angular requires Zone.js polyfill.');
|
||||
if (typeof Zone == 'undefined') {
|
||||
throw new Error('Angular requires Zone.js prolyfill.');
|
||||
}
|
||||
Zone.assertZonePatched();
|
||||
this.outer = this.inner = Zone.current;
|
||||
if ((Zone as any)['wtfZoneSpec']) {
|
||||
this.inner = this.inner.fork((Zone as any)['wtfZoneSpec']);
|
||||
}
|
||||
if (trace && (Zone as any)['longStackTraceZoneSpec']) {
|
||||
this.inner = this.inner.fork((Zone as any)['longStackTraceZoneSpec']);
|
||||
}
|
||||
this.inner = this.inner.fork({
|
||||
name: 'angular',
|
||||
properties: <any>{'isAngularZone': true},
|
||||
onInvokeTask: (delegate: ZoneDelegate, current: Zone, target: Zone, task: Task,
|
||||
applyThis: any, applyArgs: any): any => {
|
||||
try {
|
||||
this.onEnter();
|
||||
return delegate.invokeTask(target, task, applyThis, applyArgs);
|
||||
} finally {
|
||||
this.onLeave();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
onInvoke: (delegate: ZoneDelegate, current: Zone, target: Zone, callback: Function,
|
||||
applyThis: any, applyArgs: any[], source: string): any => {
|
||||
try {
|
||||
this.onEnter();
|
||||
return delegate.invoke(target, callback, applyThis, applyArgs, source);
|
||||
} finally {
|
||||
this.onLeave();
|
||||
}
|
||||
},
|
||||
|
||||
onHasTask:
|
||||
(delegate: ZoneDelegate, current: Zone, target: Zone, hasTaskState: HasTaskState) => {
|
||||
delegate.hasTask(target, hasTaskState);
|
||||
if (current === target) {
|
||||
// We are only interested in hasTask events which originate from our zone
|
||||
// (A child hasTask event is not interesting to us)
|
||||
if (hasTaskState.change == 'microTask') {
|
||||
this.setMicrotask(hasTaskState.microTask);
|
||||
} else if (hasTaskState.change == 'macroTask') {
|
||||
this.setMacrotask(hasTaskState.macroTask);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any): boolean => {
|
||||
delegate.handleError(target, error);
|
||||
this.onError(error);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
runInner(fn: () => any): any { return this.inner.run(fn); };
|
||||
|
|
|
@ -4655,7 +4655,7 @@
|
|||
}
|
||||
},
|
||||
"zone.js": {
|
||||
"version": "0.6.17"
|
||||
"version": "0.6.21"
|
||||
}
|
||||
},
|
||||
"name": "angular-srcs",
|
||||
|
|
|
@ -7421,9 +7421,8 @@
|
|||
}
|
||||
},
|
||||
"zone.js": {
|
||||
"version": "0.6.17",
|
||||
"from": "zone.js@0.6.17",
|
||||
"resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.6.17.tgz"
|
||||
"version": "0.6.21",
|
||||
"from": "zone.js@0.6.21"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
"core-js": "^2.4.1",
|
||||
"reflect-metadata": "^0.1.3",
|
||||
"rxjs": "5.0.0-beta.11",
|
||||
"zone.js": "^0.6.17"
|
||||
"zone.js": "^0.6.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/angularjs": "^1.5.13-alpha",
|
||||
|
|
|
@ -9,7 +9,7 @@ LINKABLE_PKGS=(
|
|||
PKGS=(
|
||||
reflect-metadata@0.1.8
|
||||
typescript@2.0.2
|
||||
zone.js@0.6.17
|
||||
zone.js@0.6.21
|
||||
rxjs@5.0.0-beta.11
|
||||
@types/{node@6.0.38,jasmine@2.2.33}
|
||||
jasmine@2.4.1
|
||||
|
|
Loading…
Reference in New Issue