From f073ee521e13dbc60b925fd34f7646e1a78369d1 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Wed, 15 Jan 2020 07:30:00 +0100 Subject: [PATCH] =?UTF-8?q?fix(=5F=5Fextends):=20Use=C2=A0correct=C2=A0beh?= =?UTF-8?q?aviour=20with=C2=A0`null`=C2=A0prototype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tslib.d.ts | 2 +- tslib.es6.js | 7 ++++++- tslib.js | 7 ++++++- 3 files changed, 13 insertions(+), 3 deletions(-) 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) {