Skip to content

Commit 9438355

Browse files
committed
Merge pull request #2989 from Microsoft/fixHelpersForStrict
Fixes helpers in strict mode
2 parents 892bc6d + 60ae9bd commit 9438355

File tree

558 files changed

+576
-574
lines changed

Some content is hidden

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

558 files changed

+576
-574
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ scripts/*.js.map
4646
coverage/
4747
internal/
4848
**/.DS_Store
49+
.settings/

.npmignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ scripts
44
src
55
tests
66
Jakefile
7-
.travis.yml
7+
.travis.yml
8+
.settings/

src/compiler/emitter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module ts {
1818
export function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile): EmitResult {
1919
// emit output for the __extends helper function
2020
const extendsHelper = `
21-
var __extends = this.__extends || function (d, b) {
21+
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; }
2424
__.prototype = b.prototype;
@@ -27,7 +27,7 @@ var __extends = this.__extends || function (d, b) {
2727

2828
// emit output for the __decorate helper function
2929
const decorateHelper = `
30-
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
30+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3131
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
3232
switch (arguments.length) {
3333
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
@@ -38,13 +38,13 @@ if (typeof __decorate !== "function") __decorate = function (decorators, target,
3838

3939
// emit output for the __metadata helper function
4040
const metadataHelper = `
41-
if (typeof __metadata !== "function") __metadata = function (k, v) {
41+
var __metadata = (this && this.__metadata) || function (k, v) {
4242
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
4343
};`;
4444

4545
// emit output for the __param helper function
4646
const paramHelper = `
47-
if (typeof __param !== "function") __param = function (paramIndex, decorator) {
47+
var __param = (this && this.__param) || function (paramIndex, decorator) {
4848
return function (target, key) { decorator(target, key, paramIndex); }
4949
};`;
5050

tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js

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

2222

2323
//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js]
24-
var __extends = this.__extends || function (d, b) {
24+
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; }
2727
__.prototype = b.prototype;

tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js

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

2626

2727
//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js]
28-
var __extends = this.__extends || function (d, b) {
28+
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; }
3131
__.prototype = b.prototype;

tests/baselines/reference/accessOverriddenBaseClassMember1.js

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

1717

1818
//// [accessOverriddenBaseClassMember1.js]
19-
var __extends = this.__extends || function (d, b) {
19+
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; }
2222
__.prototype = b.prototype;

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

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

2727
//// [accessors_spec_section-4.5_inference.js]
28-
var __extends = this.__extends || function (d, b) {
28+
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; }
3131
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInAccessorsOfClass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var Model = (function () {
3535
})();
3636
exports.Model = Model;
3737
//// [aliasUsage1_moduleA.js]
38-
var __extends = this.__extends || function (d, b) {
38+
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; }
4141
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInArray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var Model = (function () {
2929
})();
3030
exports.Model = Model;
3131
//// [aliasUsageInArray_moduleA.js]
32-
var __extends = this.__extends || function (d, b) {
32+
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; }
3535
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInFunctionExpression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Model = (function () {
2828
})();
2929
exports.Model = Model;
3030
//// [aliasUsageInFunctionExpression_moduleA.js]
31-
var __extends = this.__extends || function (d, b) {
31+
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; }
3434
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInGenericFunction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var Model = (function () {
3232
})();
3333
exports.Model = Model;
3434
//// [aliasUsageInGenericFunction_moduleA.js]
35-
var __extends = this.__extends || function (d, b) {
35+
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; }
3838
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInIndexerOfClass.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var Model = (function () {
3434
})();
3535
exports.Model = Model;
3636
//// [aliasUsageInIndexerOfClass_moduleA.js]
37-
var __extends = this.__extends || function (d, b) {
37+
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; }
4040
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInObjectLiteral.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var Model = (function () {
2929
})();
3030
exports.Model = Model;
3131
//// [aliasUsageInObjectLiteral_moduleA.js]
32-
var __extends = this.__extends || function (d, b) {
32+
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; }
3535
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInOrExpression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var Model = (function () {
3232
})();
3333
exports.Model = Model;
3434
//// [aliasUsageInOrExpression_moduleA.js]
35-
var __extends = this.__extends || function (d, b) {
35+
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; }
3838
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var Model = (function () {
3232
})();
3333
exports.Model = Model;
3434
//// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.js]
35-
var __extends = this.__extends || function (d, b) {
35+
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; }
3838
__.prototype = b.prototype;
@@ -48,7 +48,7 @@ var VisualizationModel = (function (_super) {
4848
})(Backbone.Model);
4949
exports.VisualizationModel = VisualizationModel;
5050
//// [aliasUsageInTypeArgumentOfExtendsClause_main.js]
51-
var __extends = this.__extends || function (d, b) {
51+
var __extends = (this && this.__extends) || function (d, b) {
5252
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
5353
function __() { this.constructor = d; }
5454
__.prototype = b.prototype;

tests/baselines/reference/aliasUsageInVarAssignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Model = (function () {
2828
})();
2929
exports.Model = Model;
3030
//// [aliasUsageInVarAssignment_moduleA.js]
31-
var __extends = this.__extends || function (d, b) {
31+
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; }
3434
__.prototype = b.prototype;

tests/baselines/reference/ambiguousOverloadResolution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ var x: B;
99
var t: number = f(x, x); // Not an error
1010

1111
//// [ambiguousOverloadResolution.js]
12-
var __extends = this.__extends || function (d, b) {
12+
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; }
1515
__.prototype = b.prototype;

tests/baselines/reference/apparentTypeSubtyping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Derived2<U extends String> extends Base2 { // error because of the prototy
2424
//// [apparentTypeSubtyping.js]
2525
// subtype checks use the apparent type of the target type
2626
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:
27-
var __extends = this.__extends || function (d, b) {
27+
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; }
3030
__.prototype = b.prototype;

tests/baselines/reference/apparentTypeSupertype.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Derived<U extends String> extends Base { // error
1414
//// [apparentTypeSupertype.js]
1515
// subtype checks use the apparent type of the target type
1616
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:
17-
var __extends = this.__extends || function (d, b) {
17+
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; }
2020
__.prototype = b.prototype;

tests/baselines/reference/arrayAssignmentTest1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ arr_any = c3; // should be an error - is
8686
arr_any = i1; // should be an error - is
8787

8888
//// [arrayAssignmentTest1.js]
89-
var __extends = this.__extends || function (d, b) {
89+
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; }
9292
__.prototype = b.prototype;

tests/baselines/reference/arrayAssignmentTest2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ arr_any = i1; // should be an error - is
6060

6161

6262
//// [arrayAssignmentTest2.js]
63-
var __extends = this.__extends || function (d, b) {
63+
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; }
6666
__.prototype = b.prototype;

tests/baselines/reference/arrayBestCommonTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ module NonEmptyTypes {
108108

109109

110110
//// [arrayBestCommonTypes.js]
111-
var __extends = this.__extends || function (d, b) {
111+
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; }
114114
__.prototype = b.prototype;

tests/baselines/reference/arrayLiteralTypeInference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ var z3: { id: number }[] =
5252

5353

5454
//// [arrayLiteralTypeInference.js]
55-
var __extends = this.__extends || function (d, b) {
55+
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; }
5858
__.prototype = b.prototype;

tests/baselines/reference/arrayLiterals.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var context4: Base[] = [new Derived1(), new Derived1()];
3838

3939
//// [arrayLiterals.js]
4040
// Empty array literal with no contextual type has type Undefined[]
41-
var __extends = this.__extends || function (d, b) {
41+
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; }
4444
__.prototype = b.prototype;

tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var myDerivedList: DerivedList<number>;
2626
var as = [list, myDerivedList]; // List<number>[]
2727

2828
//// [arrayLiteralsWithRecursiveGenerics.js]
29-
var __extends = this.__extends || function (d, b) {
29+
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; }
3232
__.prototype = b.prototype;

tests/baselines/reference/arrowFunctionContexts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ var asserted2: any;
9797

9898

9999
//// [arrowFunctionContexts.js]
100-
var __extends = this.__extends || function (d, b) {
100+
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; }
103103
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithCallSignatures3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ b18 = a18; // ok
101101

102102
//// [assignmentCompatWithCallSignatures3.js]
103103
// these are all permitted with the current rules, since we do not do contextual signature instantiation
104-
var __extends = this.__extends || function (d, b) {
104+
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; }
107107
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithCallSignatures4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module Errors {
100100

101101
//// [assignmentCompatWithCallSignatures4.js]
102102
// These are mostly permitted with the current loose rules. All ok unless otherwise noted.
103-
var __extends = this.__extends || function (d, b) {
103+
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; }
106106
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithCallSignatures5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ b18 = a18; // ok
6767

6868
//// [assignmentCompatWithCallSignatures5.js]
6969
// checking assignment compat for function types. No errors in this file
70-
var __extends = this.__extends || function (d, b) {
70+
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; }
7373
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithCallSignatures6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ b16 = x.a16;
4444

4545
//// [assignmentCompatWithCallSignatures6.js]
4646
// checking assignment compatibility relations for function types. All valid
47-
var __extends = this.__extends || function (d, b) {
47+
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; }
5050
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithConstructSignatures3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ b18 = a18; // ok
101101

102102
//// [assignmentCompatWithConstructSignatures3.js]
103103
// checking assignment compatibility relations for function types. All of these are valid.
104-
var __extends = this.__extends || function (d, b) {
104+
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; }
107107
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithConstructSignatures4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module Errors {
100100

101101
//// [assignmentCompatWithConstructSignatures4.js]
102102
// checking assignment compatibility relations for function types.
103-
var __extends = this.__extends || function (d, b) {
103+
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; }
106106
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithConstructSignatures5.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ b18 = a18; // ok
6767

6868
//// [assignmentCompatWithConstructSignatures5.js]
6969
// checking assignment compat for function types. All valid
70-
var __extends = this.__extends || function (d, b) {
70+
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; }
7373
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithConstructSignatures6.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ b16 = x.a16;
4444

4545
//// [assignmentCompatWithConstructSignatures6.js]
4646
// checking assignment compatibility relations for function types. All valid.
47-
var __extends = this.__extends || function (d, b) {
47+
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; }
5050
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithNumericIndexer.js

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

4646
//// [assignmentCompatWithNumericIndexer.js]
4747
// Derived type indexer must be subtype of base type indexer
48-
var __extends = this.__extends || function (d, b) {
48+
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; }
5151
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithNumericIndexer3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module Generics {
4242

4343
//// [assignmentCompatWithNumericIndexer3.js]
4444
// Derived type indexer must be subtype of base type indexer
45-
var __extends = this.__extends || function (d, b) {
45+
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; }
4848
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithObjectMembers4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ module WithBase {
9393

9494
//// [assignmentCompatWithObjectMembers4.js]
9595
// members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M
96-
var __extends = this.__extends || function (d, b) {
96+
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; }
9999
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module SourceHasOptional {
9090

9191
//// [assignmentCompatWithObjectMembersOptionality.js]
9292
// Derived member is not optional but base member is, should be ok
93-
var __extends = this.__extends || function (d, b) {
93+
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; }
9696
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module SourceHasOptional {
9292
//// [assignmentCompatWithObjectMembersOptionality2.js]
9393
// M is optional and S contains no property with the same name as M
9494
// N is optional and T contains no property with the same name as N
95-
var __extends = this.__extends || function (d, b) {
95+
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; }
9898
__.prototype = b.prototype;

tests/baselines/reference/assignmentCompatWithStringIndexer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module Generics {
5555

5656
//// [assignmentCompatWithStringIndexer.js]
5757
// index signatures must be compatible in assignments
58-
var __extends = this.__extends || function (d, b) {
58+
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; }
6161
__.prototype = b.prototype;

tests/baselines/reference/assignmentLHSIsValue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ foo() = value;
7171
(foo()) = value;
7272

7373
//// [assignmentLHSIsValue.js]
74-
var __extends = this.__extends || function (d, b) {
74+
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; }
7777
__.prototype = b.prototype;

0 commit comments

Comments
 (0)