Skip to content

Commit

Permalink
Ported runtime TypeError for non-function, non-null __extends (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg authored Dec 2, 2020
1 parent fcba93d commit cff487d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tslib.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 __());
Expand Down
2 changes: 2 additions & 0 deletions tslib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 __());
Expand Down

0 comments on commit cff487d

Please sign in to comment.