Skip to content

Commit cff487d

Browse files
authoredDec 2, 2020
Ported runtime TypeError for non-function, non-null __extends (#138)
1 parent fcba93d commit cff487d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
 

‎tslib.es6.js

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var extendStatics = function(d, b) {
2222
};
2323

2424
export function __extends(d, b) {
25+
if (typeof b !== "function" && b !== null)
26+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2527
extendStatics(d, b);
2628
function __() { this.constructor = d; }
2729
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());

‎tslib.js

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ var __createBinding;
6565
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6666

6767
__extends = function (d, b) {
68+
if (typeof b !== "function" && b !== null)
69+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
6870
extendStatics(d, b);
6971
function __() { this.constructor = d; }
7072
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());

0 commit comments

Comments
 (0)
Please sign in to comment.