fix(change_detection): throw ChangeDetectionError in JIT mode

This commit is contained in:
vsavkin
2015-07-05 14:46:35 -07:00
parent d2774421e8
commit c2efa23e94
8 changed files with 54 additions and 31 deletions

View File

@ -309,5 +309,6 @@ var _availableDefinitions = [
'sayHi("Jim")',
'a()(99)',
'a.sayHi("Jim")',
'passThrough([12])'
'passThrough([12])',
'invalidFn(1)'
];

View File

@ -542,16 +542,15 @@ export function main() {
});
});
// TODO vsavkin: implement it
describe('error handling', () => {
xit('should wrap exceptions into ChangeDetectionError', () => {
var val = _createChangeDetector('invalidProp');
it('should wrap exceptions into ChangeDetectionError', () => {
var val = _createChangeDetector('invalidFn(1)');
try {
val.changeDetector.detectChanges();
throw new BaseException('fail');
} catch (e) {
expect(e).toBeAnInstanceOf(ChangeDetectionError);
expect(e.location).toEqual('invalidProp in someComponent');
expect(e.location).toEqual('invalidFn(1) in location');
}
});
});