diff --git a/tslib.d.ts b/tslib.d.ts index 3ad370a..ceb97b4 100644 --- a/tslib.d.ts +++ b/tslib.d.ts @@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -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 bd73dce..a38f165 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -24,9 +24,8 @@ var extendStatics = function(d, b) { export function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + function __() {} + (d.prototype = b ? (extendStatics(d, b), __.prototype = b.prototype, new __()) : Object.create(b)).constructor = d; } export var __assign = function() { diff --git a/tslib.js b/tslib.js index 4e2462e..9aa7dc1 100644 --- a/tslib.js +++ b/tslib.js @@ -68,9 +68,8 @@ var __createBinding; __extends = function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + function __() {} + (d.prototype = b ? (extendStatics(d, b), __.prototype = b.prototype, new __()) : Object.create(b)).constructor = d; }; __assign = Object.assign || function (t) {