Skip to content

Commit 9e6a83d

Browse files
committed
change class inheritance code
1 parent a230cb7 commit 9e6a83d

File tree

660 files changed

+670
-670
lines changed

Some content is hidden

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

660 files changed

+670
-670
lines changed

src/compiler/transformers/es2015.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3338,7 +3338,7 @@ namespace ts {
33383338
priority: 0,
33393339
text: `
33403340
var __extends = (this && this.__extends) || function (d, b) {
3341-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
3341+
Object.setPrototypeOf(d, b);
33423342
function __() { this.constructor = d; }
33433343
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33443344
};`

tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module A {
2222

2323
//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js]
2424
var __extends = (this && this.__extends) || function (d, b) {
25-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
25+
Object.setPrototypeOf(d, b);
2626
function __() { this.constructor = d; }
2727
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2828
};

tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module A {
2626

2727
//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js]
2828
var __extends = (this && this.__extends) || function (d, b) {
29-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
29+
Object.setPrototypeOf(d, b);
3030
function __() { this.constructor = d; }
3131
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3232
};

tests/baselines/reference/abstractClassInLocalScope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
//// [abstractClassInLocalScope.js]
1111
var __extends = (this && this.__extends) || function (d, b) {
12-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
12+
Object.setPrototypeOf(d, b);
1313
function __() { this.constructor = d; }
1414
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1515
};

tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
//// [abstractClassInLocalScopeIsAbstract.js]
1111
var __extends = (this && this.__extends) || function (d, b) {
12-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
12+
Object.setPrototypeOf(d, b);
1313
function __() { this.constructor = d; }
1414
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
1515
};

tests/baselines/reference/abstractProperty.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class C extends B {
2323

2424
//// [abstractProperty.js]
2525
var __extends = (this && this.__extends) || function (d, b) {
26-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
26+
Object.setPrototypeOf(d, b);
2727
function __() { this.constructor = d; }
2828
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2929
};

tests/baselines/reference/abstractPropertyNegative.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract class AbstractAccessorMismatch {
4545

4646
//// [abstractPropertyNegative.js]
4747
var __extends = (this && this.__extends) || function (d, b) {
48-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
48+
Object.setPrototypeOf(d, b);
4949
function __() { this.constructor = d; }
5050
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
5151
};

tests/baselines/reference/accessOverriddenBaseClassMember1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class ColoredPoint extends Point {
1717

1818
//// [accessOverriddenBaseClassMember1.js]
1919
var __extends = (this && this.__extends) || function (d, b) {
20-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
20+
Object.setPrototypeOf(d, b);
2121
function __() { this.constructor = d; }
2222
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
2323
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class LanguageSpec_section_4_5_inference {
2626

2727
//// [accessors_spec_section-4.5_inference.js]
2828
var __extends = (this && this.__extends) || function (d, b) {
29-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
29+
Object.setPrototypeOf(d, b);
3030
function __() { this.constructor = d; }
3131
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3232
};

tests/baselines/reference/aliasUsageInAccessorsOfClass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ exports.Model = Model;
3838
//// [aliasUsage1_moduleA.js]
3939
"use strict";
4040
var __extends = (this && this.__extends) || function (d, b) {
41-
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
41+
Object.setPrototypeOf(d, b);
4242
function __() { this.constructor = d; }
4343
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4444
};

0 commit comments

Comments
 (0)