But do it during the build process for cjs. Right now we only need this when we transpile from ts directly to es5. This is only the case in our cis build, as for our browser build we only transpile from ts to es6 via ts and then use traceur to do the rest.
30 lines
927 B
TypeScript
30 lines
927 B
TypeScript
import {ProtoRecord} from './proto_record';
|
|
import {BaseException} from "angular2/src/facade/lang";
|
|
|
|
export class ExpressionChangedAfterItHasBeenChecked extends BaseException {
|
|
message: string;
|
|
|
|
constructor(proto: ProtoRecord, change: any) {
|
|
super();
|
|
this.message =
|
|
`Expression '${proto.expressionAsString}' has changed after it was checked. ` +
|
|
`Previous value: '${change.previousValue}'. Current value: '${change.currentValue}'`;
|
|
}
|
|
|
|
toString(): string { return this.message; }
|
|
}
|
|
|
|
export class ChangeDetectionError extends BaseException {
|
|
message: string;
|
|
originalException: any;
|
|
location: string;
|
|
|
|
constructor(proto: ProtoRecord, originalException: any) {
|
|
super();
|
|
this.originalException = originalException;
|
|
this.location = proto.expressionAsString;
|
|
this.message = `${this.originalException} in [${this.location}]`;
|
|
}
|
|
|
|
toString(): string { return this.message; }
|
|
} |