diff --git a/tslib.es6.js b/tslib.es6.js index c60aa60..bae9845 100644 --- a/tslib.es6.js +++ b/tslib.es6.js @@ -22,6 +22,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 __()); diff --git a/tslib.js b/tslib.js index fcf619a..b56c529 100644 --- a/tslib.js +++ b/tslib.js @@ -65,6 +65,8 @@ var __createBinding; function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; __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 __());