diff --git a/tslib.d.ts b/tslib.d.ts index caed5d7..cc1927b 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -12,7 +12,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -export declare function __extends(d: Function, b: Function): void; +export declare function __extends(d: Function, b: Function | null): void; export declare function __assign(t: any, ...sources: any[]): any; export declare function __rest(t: any, propertyNames: (string | symbol)[]): any; export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any; diff --git a/tslib.es6.js b/tslib.es6.js index 4d84182..b9fd081 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -22,9 +22,14 @@ var extendStatics = function(d, b) { }; export function __extends(d, b) { + if (b === null) { + d.prototype = Object.create(b); + return; + } extendStatics(d, b); function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + __.prototype = b.prototype; + d.prototype = new __(); } export var __assign = function() { diff --git a/tslib.js b/tslib.js index 459b59e..3e6add7 100644 --- a/tslib.js +++ b/tslib.js @@ -64,9 +64,14 @@ var __classPrivateFieldSet; function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; __extends = function (d, b) { + if (b === null) { + d.prototype = Object.create(b); + return; + } extendStatics(d, b); function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + __.prototype = b.prototype; + d.prototype = new __(); }; __assign = Object.assign || function (t) {