Skip to content

Commit 33b0a56

Browse files
committed
Merge pull request #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) {

tests/baselines/reference/aliasUsageInObjectLiteral.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("aliasUsageInObjectLiteral_backbone");
3938
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInOrExpression.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("aliasUsageInOrExpression_backbone");
4241
var VisualizationModel = (function (_super) {

tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js

Lines changed: 2 additions & 4 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("aliasUsageInTypeArgumentOfExtendsClause_backbone");
4241
var VisualizationModel = (function (_super) {
@@ -51,8 +50,7 @@ exports.VisualizationModel = VisualizationModel;
5150
var __extends = (this && this.__extends) || function (d, b) {
5251
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
5352
function __() { this.constructor = d; }
54-
__.prototype = b.prototype;
55-
d.prototype = new __();
53+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5654
};
5755
var moduleA = require("aliasUsageInTypeArgumentOfExtendsClause_moduleA");
5856
var C = (function () {

tests/baselines/reference/aliasUsageInVarAssignment.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("aliasUsageInVarAssignment_backbone");
3837
var VisualizationModel = (function (_super) {

tests/baselines/reference/ambiguousOverloadResolution.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ var t: number = f(x, x); // Not an error
1212
var __extends = (this && this.__extends) || function (d, b) {
1313
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
1414
function __() { this.constructor = d; }
15-
__.prototype = b.prototype;
16-
d.prototype = new __();
15+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1716
};
1817
var A = (function () {
1918
function A() {

tests/baselines/reference/apparentTypeSubtyping.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class Derived2<U extends String> extends Base2 { // error because of the prototy
2727
var __extends = (this && this.__extends) || function (d, b) {
2828
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
2929
function __() { this.constructor = d; }
30-
__.prototype = b.prototype;
31-
d.prototype = new __();
30+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3231
};
3332
var Base = (function () {
3433
function Base() {

tests/baselines/reference/apparentTypeSupertype.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ class Derived<U extends String> extends Base { // error
1717
var __extends = (this && this.__extends) || function (d, b) {
1818
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
1919
function __() { this.constructor = d; }
20-
__.prototype = b.prototype;
21-
d.prototype = new __();
20+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2221
};
2322
var Base = (function () {
2423
function Base() {

tests/baselines/reference/arrayAssignmentTest1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ arr_any = i1; // should be an error - is
8989
var __extends = (this && this.__extends) || function (d, b) {
9090
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
9191
function __() { this.constructor = d; }
92-
__.prototype = b.prototype;
93-
d.prototype = new __();
92+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
9493
};
9594
var C1 = (function () {
9695
function C1() {

tests/baselines/reference/arrayAssignmentTest2.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ arr_any = i1; // should be an error - is
6363
var __extends = (this && this.__extends) || function (d, b) {
6464
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
6565
function __() { this.constructor = d; }
66-
__.prototype = b.prototype;
67-
d.prototype = new __();
66+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6867
};
6968
var C1 = (function () {
7069
function C1() {

tests/baselines/reference/arrayBestCommonTypes.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ module NonEmptyTypes {
111111
var __extends = (this && this.__extends) || function (d, b) {
112112
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
113113
function __() { this.constructor = d; }
114-
__.prototype = b.prototype;
115-
d.prototype = new __();
114+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
116115
};
117116
var EmptyTypes;
118117
(function (EmptyTypes) {

tests/baselines/reference/arrayLiteralTypeInference.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ var z3: { id: number }[] =
5555
var __extends = (this && this.__extends) || function (d, b) {
5656
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
5757
function __() { this.constructor = d; }
58-
__.prototype = b.prototype;
59-
d.prototype = new __();
58+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6059
};
6160
var Action = (function () {
6261
function Action() {

tests/baselines/reference/arrayLiterals.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ var context4: Base[] = [new Derived1(), new Derived1()];
4141
var __extends = (this && this.__extends) || function (d, b) {
4242
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4343
function __() { this.constructor = d; }
44-
__.prototype = b.prototype;
45-
d.prototype = new __();
44+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4645
};
4746
var arr1 = [[], [1], ['']];
4847
var arr2 = [[null], [1], ['']];

tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ var as = [list, myDerivedList]; // List<number>[]
2929
var __extends = (this && this.__extends) || function (d, b) {
3030
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3131
function __() { this.constructor = d; }
32-
__.prototype = b.prototype;
33-
d.prototype = new __();
32+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3433
};
3534
var List = (function () {
3635
function List() {

tests/baselines/reference/arrowFunctionContexts.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ var asserted2: any;
100100
var __extends = (this && this.__extends) || function (d, b) {
101101
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
102102
function __() { this.constructor = d; }
103-
__.prototype = b.prototype;
104-
d.prototype = new __();
103+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
105104
};
106105
// Arrow function used in with statement
107106
with (window) {

tests/baselines/reference/assignmentCompatWithCallSignatures3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ b18 = a18; // ok
104104
var __extends = (this && this.__extends) || function (d, b) {
105105
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
106106
function __() { this.constructor = d; }
107-
__.prototype = b.prototype;
108-
d.prototype = new __();
107+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
109108
};
110109
var Base = (function () {
111110
function Base() {

tests/baselines/reference/assignmentCompatWithCallSignatures4.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ module Errors {
103103
var __extends = (this && this.__extends) || function (d, b) {
104104
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
105105
function __() { this.constructor = d; }
106-
__.prototype = b.prototype;
107-
d.prototype = new __();
106+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
108107
};
109108
var Errors;
110109
(function (Errors) {

tests/baselines/reference/assignmentCompatWithCallSignatures5.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ b18 = a18; // ok
7070
var __extends = (this && this.__extends) || function (d, b) {
7171
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
7272
function __() { this.constructor = d; }
73-
__.prototype = b.prototype;
74-
d.prototype = new __();
73+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
7574
};
7675
var Base = (function () {
7776
function Base() {

tests/baselines/reference/assignmentCompatWithCallSignatures6.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ b16 = x.a16;
4747
var __extends = (this && this.__extends) || function (d, b) {
4848
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4949
function __() { this.constructor = d; }
50-
__.prototype = b.prototype;
51-
d.prototype = new __();
50+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5251
};
5352
var Base = (function () {
5453
function Base() {

tests/baselines/reference/assignmentCompatWithConstructSignatures3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ b18 = a18; // ok
104104
var __extends = (this && this.__extends) || function (d, b) {
105105
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
106106
function __() { this.constructor = d; }
107-
__.prototype = b.prototype;
108-
d.prototype = new __();
107+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
109108
};
110109
var Base = (function () {
111110
function Base() {

tests/baselines/reference/assignmentCompatWithConstructSignatures4.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ module Errors {
103103
var __extends = (this && this.__extends) || function (d, b) {
104104
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
105105
function __() { this.constructor = d; }
106-
__.prototype = b.prototype;
107-
d.prototype = new __();
106+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
108107
};
109108
var Errors;
110109
(function (Errors) {

tests/baselines/reference/assignmentCompatWithConstructSignatures5.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ b18 = a18; // ok
7070
var __extends = (this && this.__extends) || function (d, b) {
7171
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
7272
function __() { this.constructor = d; }
73-
__.prototype = b.prototype;
74-
d.prototype = new __();
73+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
7574
};
7675
var Base = (function () {
7776
function Base() {

tests/baselines/reference/assignmentCompatWithConstructSignatures6.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ b16 = x.a16;
4747
var __extends = (this && this.__extends) || function (d, b) {
4848
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4949
function __() { this.constructor = d; }
50-
__.prototype = b.prototype;
51-
d.prototype = new __();
50+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5251
};
5352
var Base = (function () {
5453
function Base() {

tests/baselines/reference/assignmentCompatWithNumericIndexer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ module Generics {
4848
var __extends = (this && this.__extends) || function (d, b) {
4949
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
5050
function __() { this.constructor = d; }
51-
__.prototype = b.prototype;
52-
d.prototype = new __();
51+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5352
};
5453
var A = (function () {
5554
function A() {

tests/baselines/reference/assignmentCompatWithNumericIndexer3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ module Generics {
4545
var __extends = (this && this.__extends) || function (d, b) {
4646
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4747
function __() { this.constructor = d; }
48-
__.prototype = b.prototype;
49-
d.prototype = new __();
48+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5049
};
5150
var A = (function () {
5251
function A() {

tests/baselines/reference/assignmentCompatWithObjectMembers4.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ module WithBase {
9696
var __extends = (this && this.__extends) || function (d, b) {
9797
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
9898
function __() { this.constructor = d; }
99-
__.prototype = b.prototype;
100-
d.prototype = new __();
99+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
101100
};
102101
var OnlyDerived;
103102
(function (OnlyDerived) {

tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ module SourceHasOptional {
9393
var __extends = (this && this.__extends) || function (d, b) {
9494
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
9595
function __() { this.constructor = d; }
96-
__.prototype = b.prototype;
97-
d.prototype = new __();
96+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
9897
};
9998
var Base = (function () {
10099
function Base() {

tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ module SourceHasOptional {
9595
var __extends = (this && this.__extends) || function (d, b) {
9696
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
9797
function __() { this.constructor = d; }
98-
__.prototype = b.prototype;
99-
d.prototype = new __();
98+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
10099
};
101100
var Base = (function () {
102101
function Base() {

tests/baselines/reference/assignmentCompatWithStringIndexer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ module Generics {
5858
var __extends = (this && this.__extends) || function (d, b) {
5959
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
6060
function __() { this.constructor = d; }
61-
__.prototype = b.prototype;
62-
d.prototype = new __();
61+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6362
};
6463
var A = (function () {
6564
function A() {

tests/baselines/reference/assignmentLHSIsValue.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@ foo() = value;
7474
var __extends = (this && this.__extends) || function (d, b) {
7575
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
7676
function __() { this.constructor = d; }
77-
__.prototype = b.prototype;
78-
d.prototype = new __();
77+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
7978
};
8079
// expected error for all the LHS of assignments
8180
var value;

0 commit comments

Comments
 (0)