From a64a35a8c1549d5172e5695dc6c72a45b261b07f Mon Sep 17 00:00:00 2001 From: "Bradford C. Smith" Date: Wed, 14 Dec 2016 11:54:57 -0800 Subject: [PATCH] refactor(facade): don't expect super() to return a new Error object in BaseError (#12600) Related to #12575 --- modules/@angular/facade/src/errors.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/@angular/facade/src/errors.ts b/modules/@angular/facade/src/errors.ts index e45d83777e..71aa795b43 100644 --- a/modules/@angular/facade/src/errors.ts +++ b/modules/@angular/facade/src/errors.ts @@ -18,9 +18,12 @@ export class BaseError extends Error { _nativeError: Error; constructor(message: string) { + super(message); // Errors don't use current this, instead they create a new instance. // We have to do forward all of our api to the nativeInstance. - const nativeError = super(message) as any as Error; + // TODO(bradfordcsmith): Remove this hack when + // google/closure-compiler/issues/2102 is fixed. + const nativeError = new Error(message) as any as Error; this._nativeError = nativeError; }