Skip to content

Commit 33b0a56

Browse files
committed
Merge pull request microsoft#3524 from Microsoft/extendsNull
Support null in __extends helper
2 parents ca89881 + c67eecd commit 33b0a56

File tree

527 files changed

+973
-1506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

527 files changed

+973
-1506
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

tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ module A {
2424
var __extends = (this && this.__extends) || function (d, b) {
2525
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2626
function __() { this.constructor = d; }
27-
__.prototype = b.prototype;
28-
d.prototype = new __();
27+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2928
};
3029
var A;
3130
(function (A) {

tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ module A {
2828
var __extends = (this && this.__extends) || function (d, b) {
2929
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3030
function __() { this.constructor = d; }
31-
__.prototype = b.prototype;
32-
d.prototype = new __();
31+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3332
};
3433
var A;
3534
(function (A) {

tests/baselines/reference/accessOverriddenBaseClassMember1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ class ColoredPoint extends Point {
1919
var __extends = (this && this.__extends) || function (d, b) {
2020
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2121
function __() { this.constructor = d; }
22-
__.prototype = b.prototype;
23-
d.prototype = new __();
22+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2423
};
2524
var Point = (function () {
2625
function Point(x, y) {

tests/baselines/reference/accessors_spec_section-4.5_inference.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ class LanguageSpec_section_4_5_inference {
2828
var __extends = (this && this.__extends) || function (d, b) {
2929
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3030
function __() { this.constructor = d; }
31-
__.prototype = b.prototype;
32-
d.prototype = new __();
31+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3332
};
3433
var A = (function () {
3534
function A() {

tests/baselines/reference/aliasUsageInAccessorsOfClass.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ exports.Model = Model;
3838
var __extends = (this && this.__extends) || function (d, b) {
3939
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4040
function __() { this.constructor = d; }
41-
__.prototype = b.prototype;
42-
d.prototype = new __();
41+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4342
};
4443
var Backbone = require("aliasUsage1_backbone");
4544
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInArray.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ exports.Model = Model;
3232
var __extends = (this && this.__extends) || function (d, b) {
3333
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3434
function __() { this.constructor = d; }
35-
__.prototype = b.prototype;
36-
d.prototype = new __();
35+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3736
};
3837
var Backbone = require("aliasUsageInArray_backbone");
3938
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInFunctionExpression.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ exports.Model = Model;
3131
var __extends = (this && this.__extends) || function (d, b) {
3232
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3333
function __() { this.constructor = d; }
34-
__.prototype = b.prototype;
35-
d.prototype = new __();
34+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3635
};
3736
var Backbone = require("aliasUsageInFunctionExpression_backbone");
3837
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInGenericFunction.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ exports.Model = Model;
3535
var __extends = (this && this.__extends) || function (d, b) {
3636
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3737
function __() { this.constructor = d; }
38-
__.prototype = b.prototype;
39-
d.prototype = new __();
38+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4039
};
4140
var Backbone = require("aliasUsageInGenericFunction_backbone");
4241
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInIndexerOfClass.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ exports.Model = Model;
3737
var __extends = (this && this.__extends) || function (d, b) {
3838
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3939
function __() { this.constructor = d; }
40-
__.prototype = b.prototype;
41-
d.prototype = new __();
40+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4241
};
4342
var Backbone = require("aliasUsageInIndexerOfClass_backbone");
4443
var VisualizationModel = (function (_super) {

0 commit comments

Comments
 (0)