Skip to content

Commit 3b5d73f

Browse files
committed
Use Object.create(null) in __extends when base is null
1 parent 718dc5b commit 3b5d73f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/compiler/emitter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ namespace ts {
2121
var __extends = (this && this.__extends) || function (d, b) {
2222
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2323
function __() { this.constructor = d; }
24-
__.prototype = b.prototype;
25-
d.prototype = new __();
24+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2625
};`;
2726

2827
// emit output for the __decorate helper function

0 commit comments

Comments
 (0)