refactor(chore): remove deprecated NgZoneError (#10822)

BREAKING CHANGE: previously deprecated NgZoneError has been removed
This commit is contained in:
Igor Minar
2016-08-15 16:10:30 -07:00
committed by vikerman
parent 48751cceae
commit 3f5331be9d
7 changed files with 15 additions and 34 deletions

View File

@ -9,10 +9,7 @@
import {EventEmitter} from '../facade/async';
import {BaseException} from '../facade/exceptions';
import {NgZoneError, NgZoneImpl} from './ng_zone_impl';
export {NgZoneError} from './ng_zone_impl';
import {NgZoneImpl} from './ng_zone_impl';
/**
@ -139,7 +136,7 @@ export class NgZone {
this._checkStable();
},
setMacrotask: (hasMacrotasks: boolean) => { this._hasPendingMacrotasks = hasMacrotasks; },
onError: (error: NgZoneError) => this._onErrorEvents.emit(error)
onError: (error: any) => this._onErrorEvents.emit(error)
});
}

View File

@ -6,14 +6,6 @@
* found in the LICENSE file at https://angular.io/license
*/
/**
* Stores error information; delivered via [NgZone.onError] stream.
* @deprecated
*/
export class NgZoneError {
constructor(public error: any, public stackTrace: any) {}
}
export class NgZoneImpl {
static isInAngularZone(): boolean { return Zone.current.get('isAngularZone') === true; }
@ -27,7 +19,7 @@ export class NgZoneImpl {
private onLeave: () => void;
private setMicrotask: (hasMicrotasks: boolean) => void;
private setMacrotask: (hasMacrotasks: boolean) => void;
private onError: (error: NgZoneError) => void;
private onError: (error: any) => void;
constructor({trace, onEnter, onLeave, setMicrotask, setMacrotask, onError}: {
trace: boolean,
@ -35,7 +27,7 @@ export class NgZoneImpl {
onLeave: () => void,
setMicrotask: (hasMicrotasks: boolean) => void,
setMacrotask: (hasMacrotasks: boolean) => void,
onError: (error: NgZoneError) => void
onError: (error: any) => void
}) {
this.onEnter = onEnter;
this.onLeave = onLeave;
@ -92,7 +84,7 @@ export class NgZoneImpl {
onHandleError: (delegate: ZoneDelegate, current: Zone, target: Zone, error: any):
boolean => {
delegate.handleError(target, error);
this.onError(new NgZoneError(error, error.stack));
this.onError(error);
return false;
}
});