perf: Don’t subclass Error; resulting in smaller binary (#14160)

Subclassing errors is problematic since Error returns a
new instance. All of the patching which we do than prevent
proper application of source maps.

PR Close #14160
This commit is contained in:
Miško Hevery
2017-01-27 13:19:00 -08:00
committed by Miško Hevery
parent 3c2842be96
commit c33fda2607
51 changed files with 407 additions and 500 deletions

View File

@ -1436,21 +1436,21 @@ export function main() {
bootstrap(platformBrowserDynamic(), Ng2Module, elementA, ng1Module).then(() => {
expect(mockExceptionHandler).toHaveBeenCalledWith(jasmine.objectContaining({
originalError: new Error(
ngOriginalError: new Error(
'Unable to find required \'iDoNotExist\' in upgraded directive \'ng1A\'.')
}));
});
bootstrap(platformBrowserDynamic(), Ng2Module, elementB, ng1Module).then(() => {
expect(mockExceptionHandler).toHaveBeenCalledWith(jasmine.objectContaining({
originalError: new Error(
ngOriginalError: new Error(
'Unable to find required \'^iDoNotExist\' in upgraded directive \'ng1B\'.')
}));
});
bootstrap(platformBrowserDynamic(), Ng2Module, elementC, ng1Module).then(() => {
expect(mockExceptionHandler).toHaveBeenCalledWith(jasmine.objectContaining({
originalError: new Error(
ngOriginalError: new Error(
'Unable to find required \'^^iDoNotExist\' in upgraded directive \'ng1C\'.')
}));
});