diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index e295ba11526d2..e559350202bb9 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -3627,10 +3627,15 @@ namespace ts { scoped: false, priority: 0, text: ` - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - };` + var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })();` }; } diff --git a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js index ec0ed5494a4f1..abdbe37f2e61c 100644 --- a/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js +++ b/tests/baselines/reference/ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js @@ -21,11 +21,16 @@ module A { //// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A; (function (A) { var Point = (function () { diff --git a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js index bae9593fb98b1..c674c23ab840d 100644 --- a/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js +++ b/tests/baselines/reference/ExportClassWithInaccessibleTypeInTypeParameterConstraint.js @@ -25,11 +25,16 @@ module A { //// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A; (function (A) { var Point = (function () { diff --git a/tests/baselines/reference/abstractClassInLocalScope.js b/tests/baselines/reference/abstractClassInLocalScope.js index db5144be39981..111714fcc139c 100644 --- a/tests/baselines/reference/abstractClassInLocalScope.js +++ b/tests/baselines/reference/abstractClassInLocalScope.js @@ -8,11 +8,16 @@ //// [abstractClassInLocalScope.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); (function () { var A = (function () { function A() { diff --git a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js index 1b3e11cfa32d9..16e3e7c497d4b 100644 --- a/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js +++ b/tests/baselines/reference/abstractClassInLocalScopeIsAbstract.js @@ -8,11 +8,16 @@ //// [abstractClassInLocalScopeIsAbstract.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); (function () { var A = (function () { function A() { diff --git a/tests/baselines/reference/abstractProperty.js b/tests/baselines/reference/abstractProperty.js index fb7deaa09ddbc..0cb89665b9464 100644 --- a/tests/baselines/reference/abstractProperty.js +++ b/tests/baselines/reference/abstractProperty.js @@ -22,11 +22,16 @@ class C extends B { } //// [abstractProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/abstractPropertyNegative.js b/tests/baselines/reference/abstractPropertyNegative.js index bebf9026a0e56..1b0898de8e369 100644 --- a/tests/baselines/reference/abstractPropertyNegative.js +++ b/tests/baselines/reference/abstractPropertyNegative.js @@ -44,11 +44,16 @@ abstract class AbstractAccessorMismatch { //// [abstractPropertyNegative.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/accessOverriddenBaseClassMember1.js b/tests/baselines/reference/accessOverriddenBaseClassMember1.js index 02d092dfd393f..1fdf137a7e751 100644 --- a/tests/baselines/reference/accessOverriddenBaseClassMember1.js +++ b/tests/baselines/reference/accessOverriddenBaseClassMember1.js @@ -16,11 +16,16 @@ class ColoredPoint extends Point { //// [accessOverriddenBaseClassMember1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Point = (function () { function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/accessors_spec_section-4.5_inference.js b/tests/baselines/reference/accessors_spec_section-4.5_inference.js index dbaeec1f688ef..50a498e278c65 100644 --- a/tests/baselines/reference/accessors_spec_section-4.5_inference.js +++ b/tests/baselines/reference/accessors_spec_section-4.5_inference.js @@ -25,11 +25,16 @@ class LanguageSpec_section_4_5_inference { } //// [accessors_spec_section-4.5_inference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js index 8b60ed8e76ddd..87ce93aa104ca 100644 --- a/tests/baselines/reference/aliasUsageInAccessorsOfClass.js +++ b/tests/baselines/reference/aliasUsageInAccessorsOfClass.js @@ -37,11 +37,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsage1_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsage1_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInArray.js b/tests/baselines/reference/aliasUsageInArray.js index bf573aa9abb20..fa93daad9bcb2 100644 --- a/tests/baselines/reference/aliasUsageInArray.js +++ b/tests/baselines/reference/aliasUsageInArray.js @@ -31,11 +31,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInArray_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInArray_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInFunctionExpression.js b/tests/baselines/reference/aliasUsageInFunctionExpression.js index 49bdd493aacee..908480fb5b22d 100644 --- a/tests/baselines/reference/aliasUsageInFunctionExpression.js +++ b/tests/baselines/reference/aliasUsageInFunctionExpression.js @@ -30,11 +30,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInFunctionExpression_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInFunctionExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInGenericFunction.js b/tests/baselines/reference/aliasUsageInGenericFunction.js index dc3a8a88bab8d..f0625fde40af3 100644 --- a/tests/baselines/reference/aliasUsageInGenericFunction.js +++ b/tests/baselines/reference/aliasUsageInGenericFunction.js @@ -34,11 +34,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInGenericFunction_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInGenericFunction_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInIndexerOfClass.js b/tests/baselines/reference/aliasUsageInIndexerOfClass.js index cb7ad3027cad4..11a9a969a491c 100644 --- a/tests/baselines/reference/aliasUsageInIndexerOfClass.js +++ b/tests/baselines/reference/aliasUsageInIndexerOfClass.js @@ -36,11 +36,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInIndexerOfClass_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInIndexerOfClass_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInObjectLiteral.js b/tests/baselines/reference/aliasUsageInObjectLiteral.js index 81e3e621e850b..e82b58bab8f55 100644 --- a/tests/baselines/reference/aliasUsageInObjectLiteral.js +++ b/tests/baselines/reference/aliasUsageInObjectLiteral.js @@ -31,11 +31,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInObjectLiteral_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInObjectLiteral_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInOrExpression.js b/tests/baselines/reference/aliasUsageInOrExpression.js index 4faa41dd034f8..4dc10ee726ba4 100644 --- a/tests/baselines/reference/aliasUsageInOrExpression.js +++ b/tests/baselines/reference/aliasUsageInOrExpression.js @@ -34,11 +34,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInOrExpression_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInOrExpression_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js index 2cf4aefab6c32..e7c42281f4f59 100644 --- a/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js +++ b/tests/baselines/reference/aliasUsageInTypeArgumentOfExtendsClause.js @@ -34,11 +34,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInTypeArgumentOfExtendsClause_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); @@ -50,11 +55,16 @@ var VisualizationModel = (function (_super) { exports.VisualizationModel = VisualizationModel; //// [aliasUsageInTypeArgumentOfExtendsClause_main.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var moduleA = require("./aliasUsageInTypeArgumentOfExtendsClause_moduleA"); var C = (function () { function C() { diff --git a/tests/baselines/reference/aliasUsageInVarAssignment.js b/tests/baselines/reference/aliasUsageInVarAssignment.js index 80bb2dca20eea..1d1b1c51f2c23 100644 --- a/tests/baselines/reference/aliasUsageInVarAssignment.js +++ b/tests/baselines/reference/aliasUsageInVarAssignment.js @@ -30,11 +30,16 @@ var Model = (function () { exports.Model = Model; //// [aliasUsageInVarAssignment_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./aliasUsageInVarAssignment_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 01002792921c2..1f24276e2fbe1 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -9,11 +9,16 @@ var x: B; var t: number = f(x, x); // Not an error //// [ambiguousOverloadResolution.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/apparentTypeSubtyping.js b/tests/baselines/reference/apparentTypeSubtyping.js index 6ca9d343a721f..7bbd61d668948 100644 --- a/tests/baselines/reference/apparentTypeSubtyping.js +++ b/tests/baselines/reference/apparentTypeSubtyping.js @@ -24,11 +24,16 @@ class Derived2 extends Base2 { // error because of the prototy //// [apparentTypeSubtyping.js] // subtype checks use the apparent type of the target type // 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: -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/apparentTypeSupertype.js b/tests/baselines/reference/apparentTypeSupertype.js index c6d3378872e60..2b835917fb48e 100644 --- a/tests/baselines/reference/apparentTypeSupertype.js +++ b/tests/baselines/reference/apparentTypeSupertype.js @@ -14,11 +14,16 @@ class Derived extends Base { // error //// [apparentTypeSupertype.js] // subtype checks use the apparent type of the target type // 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: -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index a887203cd5e05..c080b83957b6e 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -86,11 +86,16 @@ arr_any = c3; // should be an error - is arr_any = i1; // should be an error - is //// [arrayAssignmentTest1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index d82dedff29d60..5e2911b13fb41 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -60,11 +60,16 @@ arr_any = i1; // should be an error - is //// [arrayAssignmentTest2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/arrayBestCommonTypes.js b/tests/baselines/reference/arrayBestCommonTypes.js index b7ddaa5d6dae4..bc78f629bcba9 100644 --- a/tests/baselines/reference/arrayBestCommonTypes.js +++ b/tests/baselines/reference/arrayBestCommonTypes.js @@ -108,11 +108,16 @@ module NonEmptyTypes { //// [arrayBestCommonTypes.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var EmptyTypes; (function (EmptyTypes) { var base = (function () { diff --git a/tests/baselines/reference/arrayLiteralTypeInference.js b/tests/baselines/reference/arrayLiteralTypeInference.js index 919d3a5e9227c..fc62da7d3a288 100644 --- a/tests/baselines/reference/arrayLiteralTypeInference.js +++ b/tests/baselines/reference/arrayLiteralTypeInference.js @@ -52,11 +52,16 @@ var z3: { id: number }[] = //// [arrayLiteralTypeInference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Action = (function () { function Action() { } diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index 530cdedec73f3..8d69ab90dcf6f 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -38,11 +38,16 @@ var context4: Base[] = [new Derived1(), new Derived1()]; //// [arrayLiterals.js] // Empty array literal with no contextual type has type Undefined[] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var arr1 = [[], [1], ['']]; var arr2 = [[null], [1], ['']]; // Array literal with elements of only EveryType E has type E[] diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index c0f320ac1e53a..bd1d38de4cb5c 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -26,11 +26,16 @@ var myDerivedList: DerivedList; var as = [list, myDerivedList]; // List[] //// [arrayLiteralsWithRecursiveGenerics.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var List = (function () { function List() { } diff --git a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js index d1d75e8041c2a..3e4e6d6a148f0 100644 --- a/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js +++ b/tests/baselines/reference/arrayOfSubtypeIsAssignableToReadonlyArray.js @@ -20,11 +20,16 @@ rrb = cra; // error: 'A' is not assignable to 'B' //// [arrayOfSubtypeIsAssignableToReadonlyArray.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 1af0797b41fde..2285aadd3d569 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -97,11 +97,16 @@ var asserted2: any; //// [arrowFunctionContexts.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; // Arrow function used in with statement with (window) { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index c5a1f41543760..f0c8557659bef 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -101,11 +101,16 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures3.js] // these are all permitted with the current rules, since we do not do contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js index 58faf663ea893..40c98239cbccf 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures4.js @@ -100,11 +100,16 @@ module Errors { //// [assignmentCompatWithCallSignatures4.js] // These are mostly permitted with the current loose rules. All ok unless otherwise noted. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js index 87506cad08fd3..2ac6493af4d3e 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures5.js @@ -67,11 +67,16 @@ b18 = a18; // ok //// [assignmentCompatWithCallSignatures5.js] // checking assignment compat for function types. No errors in this file -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js index 2c05d5960b291..1281cfc0f5d39 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures6.js @@ -44,11 +44,16 @@ b16 = x.a16; //// [assignmentCompatWithCallSignatures6.js] // checking assignment compatibility relations for function types. All valid -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index 76ad53e4e05e0..888a493985453 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -101,11 +101,16 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures3.js] // checking assignment compatibility relations for function types. All of these are valid. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js index f516df153c6b3..32081f035e653 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures4.js @@ -100,11 +100,16 @@ module Errors { //// [assignmentCompatWithConstructSignatures4.js] // checking assignment compatibility relations for function types. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js index ef7de7f011bfb..7c4e7ca53f36c 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures5.js @@ -67,11 +67,16 @@ b18 = a18; // ok //// [assignmentCompatWithConstructSignatures5.js] // checking assignment compat for function types. All valid -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js index 3d58ae707a514..5ac28d5802450 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures6.js @@ -44,11 +44,16 @@ b16 = x.a16; //// [assignmentCompatWithConstructSignatures6.js] // checking assignment compatibility relations for function types. All valid. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js index 3716050668362..59d173ebd71de 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer.js @@ -45,11 +45,16 @@ module Generics { //// [assignmentCompatWithNumericIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js index 2e6ecd72741db..afac7265036c7 100644 --- a/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js +++ b/tests/baselines/reference/assignmentCompatWithNumericIndexer3.js @@ -42,11 +42,16 @@ module Generics { //// [assignmentCompatWithNumericIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js index 2cc2510c8da7b..9204c87a172e2 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembers4.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembers4.js @@ -93,11 +93,16 @@ module WithBase { //// [assignmentCompatWithObjectMembers4.js] // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var OnlyDerived; (function (OnlyDerived) { var Base = (function () { diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js index 3b12701b3d996..1e539a9713bd2 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality.js @@ -90,11 +90,16 @@ module SourceHasOptional { //// [assignmentCompatWithObjectMembersOptionality.js] // Derived member is not optional but base member is, should be ok -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js index f965d18e2cee2..3387a818b6f29 100644 --- a/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/assignmentCompatWithObjectMembersOptionality2.js @@ -92,11 +92,16 @@ module SourceHasOptional { //// [assignmentCompatWithObjectMembersOptionality2.js] // M is optional and S contains no property with the same name as M // N is optional and T contains no property with the same name as N -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/assignmentCompatWithStringIndexer.js b/tests/baselines/reference/assignmentCompatWithStringIndexer.js index 8d081c907940e..d296c256d17c8 100644 --- a/tests/baselines/reference/assignmentCompatWithStringIndexer.js +++ b/tests/baselines/reference/assignmentCompatWithStringIndexer.js @@ -55,11 +55,16 @@ module Generics { //// [assignmentCompatWithStringIndexer.js] // index signatures must be compatible in assignments -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/assignmentLHSIsValue.js b/tests/baselines/reference/assignmentLHSIsValue.js index 155fa26fa8159..34e0df7cacd88 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.js +++ b/tests/baselines/reference/assignmentLHSIsValue.js @@ -71,11 +71,16 @@ foo() = value; (foo()) = value; //// [assignmentLHSIsValue.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // expected error for all the LHS of assignments var value; // this diff --git a/tests/baselines/reference/asyncImportedPromise_es5.js b/tests/baselines/reference/asyncImportedPromise_es5.js index 641b8e0381faa..8bf88bd16e4aa 100644 --- a/tests/baselines/reference/asyncImportedPromise_es5.js +++ b/tests/baselines/reference/asyncImportedPromise_es5.js @@ -11,11 +11,16 @@ class Test { //// [task.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Task = (function (_super) { __extends(Task, _super); function Task() { diff --git a/tests/baselines/reference/autolift4.js b/tests/baselines/reference/autolift4.js index 1c29bfeeff7f3..6d91c61d59dc8 100644 --- a/tests/baselines/reference/autolift4.js +++ b/tests/baselines/reference/autolift4.js @@ -24,11 +24,16 @@ class Point3D extends Point { //// [autolift4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Point = (function () { function Point(x, y) { this.x = x; diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 870f811c09fa6..2b4f90d27b127 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -30,11 +30,16 @@ function f() { //// [baseCheck.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C(x, y) { } diff --git a/tests/baselines/reference/baseIndexSignatureResolution.js b/tests/baselines/reference/baseIndexSignatureResolution.js index 7e922cf83b239..82818ecafbe32 100644 --- a/tests/baselines/reference/baseIndexSignatureResolution.js +++ b/tests/baselines/reference/baseIndexSignatureResolution.js @@ -25,11 +25,16 @@ var z: Derived = b.foo(); */ //// [baseIndexSignatureResolution.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/baseTypeOrderChecking.js b/tests/baselines/reference/baseTypeOrderChecking.js index ec96b80a9999f..57ee369a03c66 100644 --- a/tests/baselines/reference/baseTypeOrderChecking.js +++ b/tests/baselines/reference/baseTypeOrderChecking.js @@ -37,11 +37,16 @@ class Class4 extends Class3 //// [baseTypeOrderChecking.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var someVariable; var Class1 = (function () { function Class1() { diff --git a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js index 5f8dcbd0e10fd..d2087b3100a19 100644 --- a/tests/baselines/reference/baseTypeWrappingInstantiationChain.js +++ b/tests/baselines/reference/baseTypeWrappingInstantiationChain.js @@ -28,11 +28,16 @@ class C extends CBase { //// [baseTypeWrappingInstantiationChain.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var CBaseBase = (function () { function CBaseBase(x) { } diff --git a/tests/baselines/reference/bases.js b/tests/baselines/reference/bases.js index 6b73eb9556b2c..a1499143fd417 100644 --- a/tests/baselines/reference/bases.js +++ b/tests/baselines/reference/bases.js @@ -21,11 +21,16 @@ new C().y; //// [bases.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { this.y; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index 6d0f19dd37def..b31e773ff24ee 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -29,11 +29,16 @@ function foo5(t: T, u: U): Object { //// [bestCommonTypeOfConditionalExpressions.js] // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // no errors expected here -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a; var b; var Base = (function () { diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js index 2e2d0bcb1e2a4..31d0c03a5dc1d 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions2.js @@ -27,11 +27,16 @@ function foo3(t: T, u: U) { //// [bestCommonTypeOfConditionalExpressions2.js] // conditional expressions return the best common type of the branches plus contextual type (using the first candidate if multiple BCTs exist) // these are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/bestCommonTypeOfTuple2.js b/tests/baselines/reference/bestCommonTypeOfTuple2.js index 928909f4c3852..9b0c2be7b7686 100644 --- a/tests/baselines/reference/bestCommonTypeOfTuple2.js +++ b/tests/baselines/reference/bestCommonTypeOfTuple2.js @@ -23,11 +23,16 @@ var e51 = t5[2]; // {} //// [bestCommonTypeOfTuple2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js index 0ae7648c7f903..74b5bafad3834 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance2.js @@ -71,11 +71,16 @@ interface I extends A { //// [callSignatureAssignabilityInInheritance2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js index 7a7791280ad87..84b7e2d0a5248 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance3.js @@ -116,11 +116,16 @@ module Errors { //// [callSignatureAssignabilityInInheritance3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js index 19d66ce8d461d..04e8e2d6a2a37 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance4.js @@ -51,11 +51,16 @@ interface I extends A { //// [callSignatureAssignabilityInInheritance4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js index 1c53de5d26e7e..9fabe405db081 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance5.js @@ -51,11 +51,16 @@ interface I extends B { //// [callSignatureAssignabilityInInheritance5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithCallSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js index c42e36389ca59..52e08ae440123 100644 --- a/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/callSignatureAssignabilityInInheritance6.js @@ -54,11 +54,16 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithCallSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/callWithSpread.js b/tests/baselines/reference/callWithSpread.js index 69f7e4e30b0ac..23c1fff2d09e6 100644 --- a/tests/baselines/reference/callWithSpread.js +++ b/tests/baselines/reference/callWithSpread.js @@ -59,11 +59,16 @@ class D extends C { //// [callWithSpread.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function foo(x, y) { var z = []; for (var _i = 2; _i < arguments.length; _i++) { diff --git a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js index 4f350c1a3a39a..98ca7cb47d7e0 100644 --- a/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js +++ b/tests/baselines/reference/captureSuperPropertyAccessInSuperCall01.js @@ -12,11 +12,16 @@ class B extends A { } //// [captureSuperPropertyAccessInSuperCall01.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(f) { } diff --git a/tests/baselines/reference/captureThisInSuperCall.js b/tests/baselines/reference/captureThisInSuperCall.js index 069871f598e88..ccca2e6562fbc 100644 --- a/tests/baselines/reference/captureThisInSuperCall.js +++ b/tests/baselines/reference/captureThisInSuperCall.js @@ -9,11 +9,16 @@ class B extends A { } //// [captureThisInSuperCall.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(p) { } diff --git a/tests/baselines/reference/castingTuple.js b/tests/baselines/reference/castingTuple.js index f0178dcbbf0b2..4cff94b3b90ff 100644 --- a/tests/baselines/reference/castingTuple.js +++ b/tests/baselines/reference/castingTuple.js @@ -33,11 +33,16 @@ t4[2] = 10; //// [castingTuple.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.a = 10; diff --git a/tests/baselines/reference/chainedAssignment3.js b/tests/baselines/reference/chainedAssignment3.js index 3857867043c90..116fcd0f83d31 100644 --- a/tests/baselines/reference/chainedAssignment3.js +++ b/tests/baselines/reference/chainedAssignment3.js @@ -23,11 +23,16 @@ a = b = new A(); //// [chainedAssignment3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js index 26d341e1f6a7e..fc23b30e19722 100644 --- a/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js +++ b/tests/baselines/reference/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js @@ -20,11 +20,16 @@ class C extends B { (new Chain(new A)).then(a => new B).then(b => new C).then(c => new B).then(b => new A); //// [chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Chain = (function () { function Chain(value) { this.value = value; diff --git a/tests/baselines/reference/checkForObjectTooStrict.js b/tests/baselines/reference/checkForObjectTooStrict.js index ade99e9319b39..6d330285f6e5b 100644 --- a/tests/baselines/reference/checkForObjectTooStrict.js +++ b/tests/baselines/reference/checkForObjectTooStrict.js @@ -32,11 +32,16 @@ class Baz extends Object { //// [checkForObjectTooStrict.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo; (function (Foo) { var Object = (function () { diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js index 8ced6fce50092..40717cb47590f 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing1.js @@ -11,11 +11,16 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Based = (function () { function Based() { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js index 95b34f27b68c7..8c59c4d6682fd 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing2.js @@ -11,11 +11,16 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Based = (function () { function Based() { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js index 0e882f71fdb1d..1699b3a0f3528 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing3.js @@ -16,11 +16,16 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Based = (function () { function Based() { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js index 00f2ed22fbf7b..49dfb6e4a22fc 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing4.js @@ -20,11 +20,16 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Based = (function () { function Based() { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js index ded73f57bafa6..9936c7d97dc2c 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing5.js @@ -8,11 +8,16 @@ class Derived extends Based { } //// [checkSuperCallBeforeThisAccessing5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Based = (function () { function Based() { var arg = []; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js index 782e32362717e..8931b0090cfd1 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing6.js @@ -11,11 +11,16 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { var arg = []; diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js index 364aed4d4b079..4cb05a35aa06f 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing7.js @@ -10,11 +10,16 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing7.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(func) { } diff --git a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js index 5dd3708a3bb3d..77e4a4096d034 100644 --- a/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/checkSuperCallBeforeThisAccessing8.js @@ -11,11 +11,16 @@ class Super extends Base { } //// [checkSuperCallBeforeThisAccessing8.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { var arg = []; diff --git a/tests/baselines/reference/circularImportAlias.js b/tests/baselines/reference/circularImportAlias.js index 6fe5e604e57d3..27be18c2a2825 100644 --- a/tests/baselines/reference/circularImportAlias.js +++ b/tests/baselines/reference/circularImportAlias.js @@ -21,11 +21,16 @@ var c = new B.a.C(); //// [circularImportAlias.js] // expected no error -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B; (function (B) { B.a = A; diff --git a/tests/baselines/reference/circularTypeofWithFunctionModule.js b/tests/baselines/reference/circularTypeofWithFunctionModule.js index 1c38b9625e3e6..38bced0860858 100644 --- a/tests/baselines/reference/circularTypeofWithFunctionModule.js +++ b/tests/baselines/reference/circularTypeofWithFunctionModule.js @@ -14,11 +14,16 @@ namespace maker { //// [circularTypeofWithFunctionModule.js] // Repro from #6072 -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/classAbstractConstructorAssignability.js b/tests/baselines/reference/classAbstractConstructorAssignability.js index 35d9e75884fe0..52335c203b2c6 100644 --- a/tests/baselines/reference/classAbstractConstructorAssignability.js +++ b/tests/baselines/reference/classAbstractConstructorAssignability.js @@ -15,11 +15,16 @@ new BB; new CC; //// [classAbstractConstructorAssignability.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractCrashedOnce.js b/tests/baselines/reference/classAbstractCrashedOnce.js index fe23e60c94faa..dbad78fbd00fc 100644 --- a/tests/baselines/reference/classAbstractCrashedOnce.js +++ b/tests/baselines/reference/classAbstractCrashedOnce.js @@ -11,11 +11,16 @@ class bar extends foo { var x = new bar(); //// [classAbstractCrashedOnce.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var foo = (function () { function foo() { } diff --git a/tests/baselines/reference/classAbstractExtends.js b/tests/baselines/reference/classAbstractExtends.js index e899cb82d6d73..e0fb7ad8189c6 100644 --- a/tests/baselines/reference/classAbstractExtends.js +++ b/tests/baselines/reference/classAbstractExtends.js @@ -17,11 +17,16 @@ class E extends B { } //// [classAbstractExtends.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractFactoryFunction.js b/tests/baselines/reference/classAbstractFactoryFunction.js index 50e232a9fcac7..89b77b62a9a09 100644 --- a/tests/baselines/reference/classAbstractFactoryFunction.js +++ b/tests/baselines/reference/classAbstractFactoryFunction.js @@ -18,11 +18,16 @@ NewB(A); NewB(B); //// [classAbstractFactoryFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractGeneric.js b/tests/baselines/reference/classAbstractGeneric.js index 96df8f5f19edd..df6222f649530 100644 --- a/tests/baselines/reference/classAbstractGeneric.js +++ b/tests/baselines/reference/classAbstractGeneric.js @@ -26,11 +26,16 @@ class G extends A { } //// [classAbstractGeneric.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractInAModule.js b/tests/baselines/reference/classAbstractInAModule.js index c6a9e206bcc72..86e6b8e31530d 100644 --- a/tests/baselines/reference/classAbstractInAModule.js +++ b/tests/baselines/reference/classAbstractInAModule.js @@ -8,11 +8,16 @@ new M.A; new M.B; //// [classAbstractInAModule.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var A = (function () { diff --git a/tests/baselines/reference/classAbstractInheritance.js b/tests/baselines/reference/classAbstractInheritance.js index 297a80dd99c3d..a26a8170f537e 100644 --- a/tests/baselines/reference/classAbstractInheritance.js +++ b/tests/baselines/reference/classAbstractInheritance.js @@ -22,11 +22,16 @@ class FF extends CC {} abstract class GG extends CC {} //// [classAbstractInheritance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractInstantiations1.js b/tests/baselines/reference/classAbstractInstantiations1.js index 5abbb9c1baa6f..101dca316dfcc 100644 --- a/tests/baselines/reference/classAbstractInstantiations1.js +++ b/tests/baselines/reference/classAbstractInstantiations1.js @@ -28,11 +28,16 @@ c = new B; // // Calling new with (non)abstract classes. // -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractInstantiations2.js b/tests/baselines/reference/classAbstractInstantiations2.js index dea4c744ae0a4..8449689f84ac6 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.js +++ b/tests/baselines/reference/classAbstractInstantiations2.js @@ -52,11 +52,16 @@ class H { // error -- not declared abstract } //// [classAbstractInstantiations2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractOverrideWithAbstract.js b/tests/baselines/reference/classAbstractOverrideWithAbstract.js index 4ecebdf7b32f0..345ce20ca1fa6 100644 --- a/tests/baselines/reference/classAbstractOverrideWithAbstract.js +++ b/tests/baselines/reference/classAbstractOverrideWithAbstract.js @@ -24,11 +24,16 @@ class DD extends BB { } //// [classAbstractOverrideWithAbstract.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractSuperCalls.js b/tests/baselines/reference/classAbstractSuperCalls.js index 0197f48a429d2..e569f90528e09 100644 --- a/tests/baselines/reference/classAbstractSuperCalls.js +++ b/tests/baselines/reference/classAbstractSuperCalls.js @@ -28,11 +28,16 @@ abstract class BB extends AA { //// [classAbstractSuperCalls.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js index 74b5d62aaf532..61b5fd6fd13c4 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethod1.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethod1.js @@ -18,11 +18,16 @@ a = new C; // error, cannot instantiate abstract class. a.foo(); //// [classAbstractUsingAbstractMethod1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js index 25cf1a307c7a3..bd17fa96091fc 100644 --- a/tests/baselines/reference/classAbstractUsingAbstractMethods2.js +++ b/tests/baselines/reference/classAbstractUsingAbstractMethods2.js @@ -28,11 +28,16 @@ class DD extends AA { } //// [classAbstractUsingAbstractMethods2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classConstructorAccessibility2.js b/tests/baselines/reference/classConstructorAccessibility2.js index ef637611e8de8..7c77d13dffbee 100644 --- a/tests/baselines/reference/classConstructorAccessibility2.js +++ b/tests/baselines/reference/classConstructorAccessibility2.js @@ -47,11 +47,16 @@ var dc = new DerivedC(1); //// [classConstructorAccessibility2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseA = (function () { function BaseA(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorAccessibility4.js b/tests/baselines/reference/classConstructorAccessibility4.js index 4772ac68d119f..73451f5fab40f 100644 --- a/tests/baselines/reference/classConstructorAccessibility4.js +++ b/tests/baselines/reference/classConstructorAccessibility4.js @@ -31,11 +31,16 @@ class D { } //// [classConstructorAccessibility4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classConstructorAccessibility5.js b/tests/baselines/reference/classConstructorAccessibility5.js index d658349c2a59c..a6738e229e0ab 100644 --- a/tests/baselines/reference/classConstructorAccessibility5.js +++ b/tests/baselines/reference/classConstructorAccessibility5.js @@ -12,11 +12,16 @@ class Unrelated { //// [classConstructorAccessibility5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/classConstructorParametersAccessibility.js b/tests/baselines/reference/classConstructorParametersAccessibility.js index e0e75bcfeeb53..497f662a8b05f 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility.js @@ -27,11 +27,16 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility2.js b/tests/baselines/reference/classConstructorParametersAccessibility2.js index 84da66c3e3c9c..7a885bbd8d61f 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility2.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility2.js @@ -27,11 +27,16 @@ class Derived extends C3 { //// [classConstructorParametersAccessibility2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1(x) { this.x = x; diff --git a/tests/baselines/reference/classConstructorParametersAccessibility3.js b/tests/baselines/reference/classConstructorParametersAccessibility3.js index db9f94cf0fbf7..f96f0171046d9 100644 --- a/tests/baselines/reference/classConstructorParametersAccessibility3.js +++ b/tests/baselines/reference/classConstructorParametersAccessibility3.js @@ -14,11 +14,16 @@ var d: Derived; d.p; // public, OK //// [classConstructorParametersAccessibility3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(p) { this.p = p; diff --git a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js index 5a5440a92b591..a7fa44091c8b4 100644 --- a/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js +++ b/tests/baselines/reference/classDeclarationMergedInModuleWithContinuation.js @@ -12,11 +12,16 @@ module M { } //// [classDeclarationMergedInModuleWithContinuation.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var N = (function () { diff --git a/tests/baselines/reference/classDeclaredBeforeClassFactory.js b/tests/baselines/reference/classDeclaredBeforeClassFactory.js index 3dd1e7a4aafb6..f6cc69037c455 100644 --- a/tests/baselines/reference/classDeclaredBeforeClassFactory.js +++ b/tests/baselines/reference/classDeclaredBeforeClassFactory.js @@ -8,11 +8,16 @@ function makeBaseClass() { //// [classDeclaredBeforeClassFactory.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Should be OK due to hoisting var Derived = (function (_super) { __extends(Derived, _super); diff --git a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js index 076412e164dba..9fc1aecd9b206 100644 --- a/tests/baselines/reference/classDoesNotDependOnBaseTypes.js +++ b/tests/baselines/reference/classDoesNotDependOnBaseTypes.js @@ -13,11 +13,16 @@ class StringTreeCollectionBase { class StringTreeCollection extends StringTreeCollectionBase { } //// [classDoesNotDependOnBaseTypes.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; if (typeof x !== "string") { x[0] = ""; diff --git a/tests/baselines/reference/classExpression2.js b/tests/baselines/reference/classExpression2.js index 59b62c60cfe29..6973fbec81646 100644 --- a/tests/baselines/reference/classExpression2.js +++ b/tests/baselines/reference/classExpression2.js @@ -3,11 +3,16 @@ class D { } var v = class C extends D {}; //// [classExpression2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function () { function D() { } diff --git a/tests/baselines/reference/classExpression3.js b/tests/baselines/reference/classExpression3.js index c0376c54c27af..858238d24ee2e 100644 --- a/tests/baselines/reference/classExpression3.js +++ b/tests/baselines/reference/classExpression3.js @@ -7,11 +7,16 @@ c.c; //// [classExpression3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(class_1, _super); function class_1() { diff --git a/tests/baselines/reference/classExpressionExtendingAbstractClass.js b/tests/baselines/reference/classExpressionExtendingAbstractClass.js index 7312ab6567dcb..1ce5078ed6343 100644 --- a/tests/baselines/reference/classExpressionExtendingAbstractClass.js +++ b/tests/baselines/reference/classExpressionExtendingAbstractClass.js @@ -9,11 +9,16 @@ var C = class extends A { // no error reported! //// [classExpressionExtendingAbstractClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classExtendingBuiltinType.js b/tests/baselines/reference/classExtendingBuiltinType.js index 4c95e3008eaf9..2ddf4c8961dde 100644 --- a/tests/baselines/reference/classExtendingBuiltinType.js +++ b/tests/baselines/reference/classExtendingBuiltinType.js @@ -12,11 +12,16 @@ class C10 extends Array { } //// [classExtendingBuiltinType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function (_super) { __extends(C1, _super); function C1() { diff --git a/tests/baselines/reference/classExtendingClass.js b/tests/baselines/reference/classExtendingClass.js index 91e3752980cd9..22bb12d95ec37 100644 --- a/tests/baselines/reference/classExtendingClass.js +++ b/tests/baselines/reference/classExtendingClass.js @@ -32,11 +32,16 @@ var r7 = d2.thing(''); var r8 = D2.other(1); //// [classExtendingClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/classExtendingClassLikeType.js b/tests/baselines/reference/classExtendingClassLikeType.js index bfc10c2356394..564fd14da51c0 100644 --- a/tests/baselines/reference/classExtendingClassLikeType.js +++ b/tests/baselines/reference/classExtendingClassLikeType.js @@ -59,11 +59,16 @@ class D5 extends getBadBase() { //// [classExtendingClassLikeType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Error, no Base constructor function var D0 = (function (_super) { __extends(D0, _super); diff --git a/tests/baselines/reference/classExtendingNonConstructor.js b/tests/baselines/reference/classExtendingNonConstructor.js index 574d50044860e..2a2e0b5eebc0d 100644 --- a/tests/baselines/reference/classExtendingNonConstructor.js +++ b/tests/baselines/reference/classExtendingNonConstructor.js @@ -15,11 +15,16 @@ class C7 extends foo { } //// [classExtendingNonConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; function foo() { this.x = 1; diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index 8d5d73329aa3e..4d9eaba615e25 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -4,11 +4,16 @@ class C2 extends (null) { } //// [classExtendingNull.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function (_super) { __extends(C1, _super); function C1() { diff --git a/tests/baselines/reference/classExtendingPrimitive.js b/tests/baselines/reference/classExtendingPrimitive.js index 53cb45c208187..ade53d91a74a2 100644 --- a/tests/baselines/reference/classExtendingPrimitive.js +++ b/tests/baselines/reference/classExtendingPrimitive.js @@ -16,11 +16,16 @@ class C8 extends E { } //// [classExtendingPrimitive.js] // classes cannot extend primitives -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendingPrimitive2.js b/tests/baselines/reference/classExtendingPrimitive2.js index b32dc31a5b400..4e2c314b2dd66 100644 --- a/tests/baselines/reference/classExtendingPrimitive2.js +++ b/tests/baselines/reference/classExtendingPrimitive2.js @@ -6,11 +6,16 @@ class C5a extends null { } //// [classExtendingPrimitive2.js] // classes cannot extend primitives -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C4a = (function () { function C4a() { } diff --git a/tests/baselines/reference/classExtendingQualifiedName.js b/tests/baselines/reference/classExtendingQualifiedName.js index fced8c2a37322..59a84ba3e0a40 100644 --- a/tests/baselines/reference/classExtendingQualifiedName.js +++ b/tests/baselines/reference/classExtendingQualifiedName.js @@ -8,11 +8,16 @@ module M { } //// [classExtendingQualifiedName.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var C = (function () { diff --git a/tests/baselines/reference/classExtendingQualifiedName2.js b/tests/baselines/reference/classExtendingQualifiedName2.js index c133ceb87dc54..b2b91a9aedbe4 100644 --- a/tests/baselines/reference/classExtendingQualifiedName2.js +++ b/tests/baselines/reference/classExtendingQualifiedName2.js @@ -8,11 +8,16 @@ module M { } //// [classExtendingQualifiedName2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var C = (function () { diff --git a/tests/baselines/reference/classExtendsAcrossFiles.js b/tests/baselines/reference/classExtendsAcrossFiles.js index 5be0ab8f9c0a3..e8d4c530da1e7 100644 --- a/tests/baselines/reference/classExtendsAcrossFiles.js +++ b/tests/baselines/reference/classExtendsAcrossFiles.js @@ -21,11 +21,16 @@ export const b = { //// [b.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a_1 = require("./a"); exports.b = { f: function () { @@ -46,11 +51,16 @@ exports.b = { }; //// [a.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var b_1 = require("./b"); exports.a = { f: function () { diff --git a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js index 91f96450d8724..fb44ad9469afd 100644 --- a/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassMergedWithModuleNotReferingConstructor.js @@ -14,11 +14,16 @@ module Foo { } //// [classExtendsClauseClassMergedWithModuleNotReferingConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js index 6c3dc7894452d..d70305fe5ba7e 100644 --- a/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js +++ b/tests/baselines/reference/classExtendsClauseClassNotReferringConstructor.js @@ -7,11 +7,16 @@ module Foo { //// [classExtendsClauseClassNotReferringConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classExtendsEveryObjectType.js b/tests/baselines/reference/classExtendsEveryObjectType.js index a19f5d5cdd682..ef16075c7279a 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType.js +++ b/tests/baselines/reference/classExtendsEveryObjectType.js @@ -17,11 +17,16 @@ class C5 extends foo { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendsEveryObjectType2.js b/tests/baselines/reference/classExtendsEveryObjectType2.js index fbc364ca5dad2..507a9bbfcf936 100644 --- a/tests/baselines/reference/classExtendsEveryObjectType2.js +++ b/tests/baselines/reference/classExtendsEveryObjectType2.js @@ -4,11 +4,16 @@ class C2 extends { foo: string; } { } // error class C6 extends []{ } // error //// [classExtendsEveryObjectType2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C2 = (function (_super) { __extends(C2, _super); function C2() { diff --git a/tests/baselines/reference/classExtendsInterface.js b/tests/baselines/reference/classExtendsInterface.js index b59462243172c..f291aedb4ece9 100644 --- a/tests/baselines/reference/classExtendsInterface.js +++ b/tests/baselines/reference/classExtendsInterface.js @@ -9,11 +9,16 @@ class B2 implements Comparable2 {} //// [classExtendsInterface.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function (_super) { __extends(A, _super); function A() { diff --git a/tests/baselines/reference/classExtendsInterfaceInExpression.js b/tests/baselines/reference/classExtendsInterfaceInExpression.js index 9dcd8dd727988..b37daba7f7a00 100644 --- a/tests/baselines/reference/classExtendsInterfaceInExpression.js +++ b/tests/baselines/reference/classExtendsInterfaceInExpression.js @@ -9,11 +9,16 @@ class C extends factory(A) {} //// [classExtendsInterfaceInExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function factory(a) { return null; } diff --git a/tests/baselines/reference/classExtendsInterfaceInModule.js b/tests/baselines/reference/classExtendsInterfaceInModule.js index 9da8831a1389f..2299df89ab7a2 100644 --- a/tests/baselines/reference/classExtendsInterfaceInModule.js +++ b/tests/baselines/reference/classExtendsInterfaceInModule.js @@ -16,11 +16,16 @@ class D extends Mod.Nested.I {} //// [classExtendsInterfaceInModule.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function (_super) { __extends(C1, _super); function C1() { diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 36f2263d671ee..8f6aecec8439e 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -6,11 +6,16 @@ class D extends D { } // error class E extends E { } // error //// [classExtendsItself.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index 0f3f48d2f2c18..4ca9186f89c2f 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -12,11 +12,16 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index e215a07c3571e..86d2cd6088742 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -23,11 +23,16 @@ module O { } //// [classExtendsItselfIndirectly2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index f8366d77e1349..1c42dc28634ea 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -19,11 +19,16 @@ class D2 extends C2 { bar: T; } class E2 extends D2 { baz: T; } //// [classExtendsItselfIndirectly_file1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { @@ -32,11 +37,16 @@ var C = (function (_super) { return C; }(E)); // error //// [classExtendsItselfIndirectly_file2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { @@ -45,11 +55,16 @@ var D = (function (_super) { return D; }(C)); //// [classExtendsItselfIndirectly_file3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var E = (function (_super) { __extends(E, _super); function E() { @@ -58,11 +73,16 @@ var E = (function (_super) { return E; }(D)); //// [classExtendsItselfIndirectly_file4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C2 = (function (_super) { __extends(C2, _super); function C2() { @@ -71,11 +91,16 @@ var C2 = (function (_super) { return C2; }(E2)); // error //// [classExtendsItselfIndirectly_file5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D2 = (function (_super) { __extends(D2, _super); function D2() { @@ -84,11 +109,16 @@ var D2 = (function (_super) { return D2; }(C2)); //// [classExtendsItselfIndirectly_file6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var E2 = (function (_super) { __extends(E2, _super); function E2() { diff --git a/tests/baselines/reference/classExtendsMultipleBaseClasses.js b/tests/baselines/reference/classExtendsMultipleBaseClasses.js index cd9c28ad28319..a36ab4355ad10 100644 --- a/tests/baselines/reference/classExtendsMultipleBaseClasses.js +++ b/tests/baselines/reference/classExtendsMultipleBaseClasses.js @@ -4,11 +4,16 @@ class B { } class C extends A,B { } //// [classExtendsMultipleBaseClasses.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classExtendsNull.js b/tests/baselines/reference/classExtendsNull.js index 1eeb5172caddb..07618bead380a 100644 --- a/tests/baselines/reference/classExtendsNull.js +++ b/tests/baselines/reference/classExtendsNull.js @@ -13,11 +13,16 @@ class D extends null { } //// [classExtendsNull.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js index ddaadc2dc628a..908c91850e8ee 100644 --- a/tests/baselines/reference/classExtendsShadowedConstructorFunction.js +++ b/tests/baselines/reference/classExtendsShadowedConstructorFunction.js @@ -9,11 +9,16 @@ module M { } //// [classExtendsShadowedConstructorFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 31bff6e430c4d..fbbb91d29eab1 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -6,11 +6,16 @@ var x = new foo(); // can be used as a constructor function class C extends foo { } // error, cannot extend it though //// [classExtendsValidConstructorFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function foo() { } var x = new foo(); // can be used as a constructor function var C = (function (_super) { diff --git a/tests/baselines/reference/classHeritageWithTrailingSeparator.js b/tests/baselines/reference/classHeritageWithTrailingSeparator.js index 12265f569bd56..72779e9eb9797 100644 --- a/tests/baselines/reference/classHeritageWithTrailingSeparator.js +++ b/tests/baselines/reference/classHeritageWithTrailingSeparator.js @@ -4,11 +4,16 @@ class D extends C, { } //// [classHeritageWithTrailingSeparator.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 5e3eae465438c..80acbd8d20471 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -14,11 +14,16 @@ c = c2; c2 = c; //// [classImplementsClass2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classImplementsClass3.js b/tests/baselines/reference/classImplementsClass3.js index 5fd003e93b908..4c2d096f46587 100644 --- a/tests/baselines/reference/classImplementsClass3.js +++ b/tests/baselines/reference/classImplementsClass3.js @@ -15,11 +15,16 @@ c = c2; c2 = c; //// [classImplementsClass3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classImplementsClass4.js b/tests/baselines/reference/classImplementsClass4.js index 477288972df22..49c43b8ef3aa0 100644 --- a/tests/baselines/reference/classImplementsClass4.js +++ b/tests/baselines/reference/classImplementsClass4.js @@ -17,11 +17,16 @@ c = c2; c2 = c; //// [classImplementsClass4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.x = 1; diff --git a/tests/baselines/reference/classImplementsClass5.js b/tests/baselines/reference/classImplementsClass5.js index 0ec258ab77bf3..a10b08fad2d8b 100644 --- a/tests/baselines/reference/classImplementsClass5.js +++ b/tests/baselines/reference/classImplementsClass5.js @@ -18,11 +18,16 @@ c = c2; c2 = c; //// [classImplementsClass5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.x = 1; diff --git a/tests/baselines/reference/classImplementsClass6.js b/tests/baselines/reference/classImplementsClass6.js index 0771c56415cc9..ec81446480119 100644 --- a/tests/baselines/reference/classImplementsClass6.js +++ b/tests/baselines/reference/classImplementsClass6.js @@ -22,11 +22,16 @@ c.bar(); // error c2.bar(); // should error //// [classImplementsClass6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classIndexer3.js b/tests/baselines/reference/classIndexer3.js index 2e55c89464526..f50c50e4c901b 100644 --- a/tests/baselines/reference/classIndexer3.js +++ b/tests/baselines/reference/classIndexer3.js @@ -11,11 +11,16 @@ class D123 extends C123 { } //// [classIndexer3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C123 = (function () { function C123() { } diff --git a/tests/baselines/reference/classInheritence.js b/tests/baselines/reference/classInheritence.js index f68d76fad47f1..61a2ce9f262b8 100644 --- a/tests/baselines/reference/classInheritence.js +++ b/tests/baselines/reference/classInheritence.js @@ -3,11 +3,16 @@ class B extends A { } class A extends A { } //// [classInheritence.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function (_super) { __extends(B, _super); function B() { diff --git a/tests/baselines/reference/classIsSubtypeOfBaseType.js b/tests/baselines/reference/classIsSubtypeOfBaseType.js index 52300987d8ebd..ec7a1f1babfaf 100644 --- a/tests/baselines/reference/classIsSubtypeOfBaseType.js +++ b/tests/baselines/reference/classIsSubtypeOfBaseType.js @@ -16,11 +16,16 @@ class Derived2 extends Base<{ bar: string; }> { } //// [classIsSubtypeOfBaseType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/classOrder2.js b/tests/baselines/reference/classOrder2.js index 63490fa29b174..e7dd695973182 100644 --- a/tests/baselines/reference/classOrder2.js +++ b/tests/baselines/reference/classOrder2.js @@ -20,11 +20,16 @@ a.foo(); //// [classOrder2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function (_super) { __extends(A, _super); function A() { diff --git a/tests/baselines/reference/classOrderBug.js b/tests/baselines/reference/classOrderBug.js index e21a5ed64cff7..5631152514f47 100644 --- a/tests/baselines/reference/classOrderBug.js +++ b/tests/baselines/reference/classOrderBug.js @@ -16,11 +16,16 @@ class foo extends baz {} //// [classOrderBug.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var bar = (function () { function bar() { this.baz = new foo(); diff --git a/tests/baselines/reference/classSideInheritance1.js b/tests/baselines/reference/classSideInheritance1.js index 9443509032cb1..cb958b2e12ee9 100644 --- a/tests/baselines/reference/classSideInheritance1.js +++ b/tests/baselines/reference/classSideInheritance1.js @@ -16,11 +16,16 @@ A.bar(); // valid C2.bar(); // valid //// [classSideInheritance1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/classSideInheritance2.js b/tests/baselines/reference/classSideInheritance2.js index 67ee666749b75..9887472615f4d 100644 --- a/tests/baselines/reference/classSideInheritance2.js +++ b/tests/baselines/reference/classSideInheritance2.js @@ -21,11 +21,16 @@ class TextBase implements IText { } //// [classSideInheritance2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SubText = (function (_super) { __extends(SubText, _super); function SubText(text, span) { diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 589dd81c5c693..9ce60d012f40d 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -19,11 +19,16 @@ var r2: new (x: string) => A = B; // error var r3: typeof A = C; // ok //// [classSideInheritance3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(x) { this.x = x; diff --git a/tests/baselines/reference/classUpdateTests.js b/tests/baselines/reference/classUpdateTests.js index 53ef71d0e4be7..eb9541ab7370c 100644 --- a/tests/baselines/reference/classUpdateTests.js +++ b/tests/baselines/reference/classUpdateTests.js @@ -114,11 +114,16 @@ class R { } //// [classUpdateTests.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // // test codegen for instance properties // diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index c25687d3c74cd..249fa099007a3 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -41,11 +41,16 @@ var d5 = new D(); // error var d6 = new D(1); // ok //// [classWithBaseClassButNoConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { } diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index f445d22d18f88..07b592bf730ba 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -50,11 +50,16 @@ module Generics { } //// [classWithConstructors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var NonGeneric; (function (NonGeneric) { var C = (function () { diff --git a/tests/baselines/reference/classWithProtectedProperty.js b/tests/baselines/reference/classWithProtectedProperty.js index 2cb8a4e0a50ad..0a2bb39b4493d 100644 --- a/tests/baselines/reference/classWithProtectedProperty.js +++ b/tests/baselines/reference/classWithProtectedProperty.js @@ -29,11 +29,16 @@ class D extends C { //// [classWithProtectedProperty.js] // accessing any protected outside the class is an error -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.a = ''; diff --git a/tests/baselines/reference/classWithStaticMembers.js b/tests/baselines/reference/classWithStaticMembers.js index 9e79780d5cc6a..0e08046f8c258 100644 --- a/tests/baselines/reference/classWithStaticMembers.js +++ b/tests/baselines/reference/classWithStaticMembers.js @@ -20,11 +20,16 @@ var r2 = r.x; var r3 = r.foo; //// [classWithStaticMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C(a, b) { this.a = a; diff --git a/tests/baselines/reference/classdecl.js b/tests/baselines/reference/classdecl.js index a3059757d2fba..97ccd8e1410b5 100644 --- a/tests/baselines/reference/classdecl.js +++ b/tests/baselines/reference/classdecl.js @@ -94,11 +94,16 @@ class e { } //// [classdecl.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a(ns) { } diff --git a/tests/baselines/reference/clodulesDerivedClasses.js b/tests/baselines/reference/clodulesDerivedClasses.js index ea4bfcf301f75..a622261b685c3 100644 --- a/tests/baselines/reference/clodulesDerivedClasses.js +++ b/tests/baselines/reference/clodulesDerivedClasses.js @@ -23,11 +23,16 @@ module Path.Utils { //// [clodulesDerivedClasses.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Shape = (function () { function Shape() { } diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js index 85c0e398fbd0f..5f7fc0cccdf8a 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInAccessors.js @@ -40,11 +40,16 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInAccessors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function _super() { } var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js index d4a22b731f2cf..d516c06ad1871 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInConstructor.js @@ -25,11 +25,16 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function _super() { } var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js index 81c069da169d9..1401411ad8ee4 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInMethod.js @@ -29,11 +29,16 @@ class c extends Foo { } //// [collisionSuperAndLocalFunctionInMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function _super() { } var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js index 67b7f0e399197..99fe7e8dcef74 100644 --- a/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalFunctionInProperty.js @@ -19,11 +19,16 @@ class b extends Foo { } //// [collisionSuperAndLocalFunctionInProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function _super() { } var Foo = (function () { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js index 26f782c0d17aa..3278f9bd3a835 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInAccessors.js @@ -33,11 +33,16 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInAccessors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _super = 10; // No Error var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index e3069352c0865..dcbf08024a953 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -21,11 +21,16 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _super = 10; // No Error var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index 0524d993ba1b0..541035dd43b92 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -19,11 +19,16 @@ class c extends Foo { } //// [collisionSuperAndLocalVarInMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _super = 10; // No Error var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index d793e022c6b74..8371687ff3475 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -18,11 +18,16 @@ class b extends Foo { } //// [collisionSuperAndLocalVarInProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _super = 10; // No Error var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index cb5636ec904b2..165943ec132f5 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -12,11 +12,16 @@ class Foo extends base { } //// [collisionSuperAndNameResolution.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var console; var _super = 10; // No error var base = (function () { diff --git a/tests/baselines/reference/collisionSuperAndParameter.js b/tests/baselines/reference/collisionSuperAndParameter.js index f5765043c5502..e2771fadf1fa6 100644 --- a/tests/baselines/reference/collisionSuperAndParameter.js +++ b/tests/baselines/reference/collisionSuperAndParameter.js @@ -63,11 +63,16 @@ class Foo4 extends Foo { } //// [collisionSuperAndParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/collisionSuperAndParameter1.js b/tests/baselines/reference/collisionSuperAndParameter1.js index ed19500f9d4d8..818f15b3f1571 100644 --- a/tests/baselines/reference/collisionSuperAndParameter1.js +++ b/tests/baselines/reference/collisionSuperAndParameter1.js @@ -10,11 +10,16 @@ class Foo2 extends Foo { } //// [collisionSuperAndParameter1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js index 5fa7fe290914e..f905e5208662a 100644 --- a/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js +++ b/tests/baselines/reference/collisionSuperAndPropertyNameAsConstuctorParameter.js @@ -31,11 +31,16 @@ class b4 extends a { } //// [collisionSuperAndPropertyNameAsConstuctorParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js index 9e8132c68838f..a5e68e4eaab45 100644 --- a/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js +++ b/tests/baselines/reference/collisionThisExpressionAndLocalVarWithSuperExperssion.js @@ -19,11 +19,16 @@ class b2 extends a { } //// [collisionThisExpressionAndLocalVarWithSuperExperssion.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/commentsInheritance.js b/tests/baselines/reference/commentsInheritance.js index 3527f5d23bb6f..26150c60d1266 100644 --- a/tests/baselines/reference/commentsInheritance.js +++ b/tests/baselines/reference/commentsInheritance.js @@ -152,11 +152,16 @@ i2_i = i3_i; //// [commentsInheritance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var c1 = (function () { function c1() { } diff --git a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js index a263a30e38285..39a53a241c943 100644 --- a/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js +++ b/tests/baselines/reference/comparisonOperatorWithIdenticalObjects.js @@ -195,11 +195,16 @@ var r8b6 = b5 !== a5; var r8b7 = b6 !== a6; //// [comparisonOperatorWithIdenticalObjects.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A1 = (function () { function A1() { } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js index b8584522b7baf..63bd4442479bc 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js @@ -169,11 +169,16 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnCallSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js index 93e1e876a7fd4..05657e3ec5e01 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js @@ -169,11 +169,16 @@ var r8b6 = b6 !== a6; var r8b7 = b7 !== a7; //// [comparisonOperatorWithNoRelationshipObjectsOnConstructorSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js index a8973bf2c1098..685fb769e996f 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js @@ -112,11 +112,16 @@ var r8b3 = b3 !== a3; var r8b4 = b4 !== a4; //// [comparisonOperatorWithNoRelationshipObjectsOnIndexSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js index 4539538782d77..48d598efe262d 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js @@ -150,11 +150,16 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedCallSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js index 5e8412bc3610a..c5e512a735bcf 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js @@ -150,11 +150,16 @@ var r8b5 = b5 !== a5; var r8b6 = b6 !== a6; //// [comparisonOperatorWithNoRelationshipObjectsOnInstantiatedConstructorSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js index d30c3586b12c3..e93fc8c7b50a8 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnCallSignature.js @@ -260,11 +260,16 @@ var r8b11 = b11 !== a11; //var r8b12 = b12 !== a12; //// [comparisonOperatorWithSubtypeObjectOnCallSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js index 4235c1352d480..a0e7b1a424e7a 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnConstructorSignature.js @@ -222,11 +222,16 @@ var r8b9 = b9 !== a9; //var r8b10 = b10 !== a10; //// [comparisonOperatorWithSubtypeObjectOnConstructorSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js index 9a6fecd668d21..e8d706eb29088 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnIndexSignature.js @@ -108,11 +108,16 @@ var r8b1 = b3 !== a3; var r8b1 = b4 !== a4; //// [comparisonOperatorWithSubtypeObjectOnIndexSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js index 5721a4524864c..51e077113dd2a 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js @@ -165,11 +165,16 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedCallSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js index b6bf8a16e614e..86c6fb86be295 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js @@ -165,11 +165,16 @@ var r8b6 = b6 !== a6; //var r8b7 = b7 !== a7; //// [comparisonOperatorWithSubtypeObjectOnInstantiatedConstructorSignature.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js index 690214fc00fa6..2cd9fc1bb290a 100644 --- a/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js +++ b/tests/baselines/reference/comparisonOperatorWithSubtypeObjectOnProperty.js @@ -79,11 +79,16 @@ var rh3 = b1 !== a1; var rh4 = b2 !== a2; //// [comparisonOperatorWithSubtypeObjectOnProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/complexClassRelationships.js b/tests/baselines/reference/complexClassRelationships.js index 4f48e5fc2c5d2..8a865e2d0240f 100644 --- a/tests/baselines/reference/complexClassRelationships.js +++ b/tests/baselines/reference/complexClassRelationships.js @@ -48,11 +48,16 @@ class FooBase { } //// [complexClassRelationships.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // There should be no errors in this file var Derived = (function (_super) { __extends(Derived, _super); diff --git a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js index 326c0830c4fe8..5af6a97f7815a 100644 --- a/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js +++ b/tests/baselines/reference/complicatedGenericRecursiveBaseClassReference.js @@ -6,11 +6,16 @@ class S18 extends S18 //// [complicatedGenericRecursiveBaseClassReference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var S18 = (function (_super) { __extends(S18, _super); function S18() { diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.js b/tests/baselines/reference/compoundAssignmentLHSIsValue.js index df3015731c71f..064f2157c1ecc 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.js @@ -124,11 +124,16 @@ foo() += value; (foo()) += value; //// [compoundAssignmentLHSIsValue.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js index d188a59258834..bd152ea11ad75 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.js @@ -86,11 +86,16 @@ foo() **= value; (foo()) **= value; //// [compoundExponentiationAssignmentLHSIsValue.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // expected error for all the LHS of compound assignments (arithmetic and addition) var value; // this diff --git a/tests/baselines/reference/computedPropertyNames24_ES5.js b/tests/baselines/reference/computedPropertyNames24_ES5.js index ff9112755bd53..ab1d81e8fb0a8 100644 --- a/tests/baselines/reference/computedPropertyNames24_ES5.js +++ b/tests/baselines/reference/computedPropertyNames24_ES5.js @@ -9,11 +9,16 @@ class C extends Base { } //// [computedPropertyNames24_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames25_ES5.js b/tests/baselines/reference/computedPropertyNames25_ES5.js index dad9c5c291aeb..6443c3cedb232 100644 --- a/tests/baselines/reference/computedPropertyNames25_ES5.js +++ b/tests/baselines/reference/computedPropertyNames25_ES5.js @@ -14,11 +14,16 @@ class C extends Base { } //// [computedPropertyNames25_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames26_ES5.js b/tests/baselines/reference/computedPropertyNames26_ES5.js index 5db7768270a6f..a34bcef3b3d5e 100644 --- a/tests/baselines/reference/computedPropertyNames26_ES5.js +++ b/tests/baselines/reference/computedPropertyNames26_ES5.js @@ -11,11 +11,16 @@ class C extends Base { } //// [computedPropertyNames26_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames27_ES5.js b/tests/baselines/reference/computedPropertyNames27_ES5.js index 381805659e271..00d9c9f0f4341 100644 --- a/tests/baselines/reference/computedPropertyNames27_ES5.js +++ b/tests/baselines/reference/computedPropertyNames27_ES5.js @@ -6,11 +6,16 @@ class C extends Base { } //// [computedPropertyNames27_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames28_ES5.js b/tests/baselines/reference/computedPropertyNames28_ES5.js index ab765c56dd75f..c6e2c5d77320f 100644 --- a/tests/baselines/reference/computedPropertyNames28_ES5.js +++ b/tests/baselines/reference/computedPropertyNames28_ES5.js @@ -11,11 +11,16 @@ class C extends Base { } //// [computedPropertyNames28_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames30_ES5.js b/tests/baselines/reference/computedPropertyNames30_ES5.js index c2c7cddd97170..f029b9b865132 100644 --- a/tests/baselines/reference/computedPropertyNames30_ES5.js +++ b/tests/baselines/reference/computedPropertyNames30_ES5.js @@ -16,11 +16,16 @@ class C extends Base { } //// [computedPropertyNames30_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames31_ES5.js b/tests/baselines/reference/computedPropertyNames31_ES5.js index 00cc765f4cc61..fd0db774e71d3 100644 --- a/tests/baselines/reference/computedPropertyNames31_ES5.js +++ b/tests/baselines/reference/computedPropertyNames31_ES5.js @@ -16,11 +16,16 @@ class C extends Base { } //// [computedPropertyNames31_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/computedPropertyNames43_ES5.js b/tests/baselines/reference/computedPropertyNames43_ES5.js index b1bb0fec72c22..e49d4426cf7be 100644 --- a/tests/baselines/reference/computedPropertyNames43_ES5.js +++ b/tests/baselines/reference/computedPropertyNames43_ES5.js @@ -13,11 +13,16 @@ class D extends C { } //// [computedPropertyNames43_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames44_ES5.js b/tests/baselines/reference/computedPropertyNames44_ES5.js index bf940f15014a4..46029ee54759d 100644 --- a/tests/baselines/reference/computedPropertyNames44_ES5.js +++ b/tests/baselines/reference/computedPropertyNames44_ES5.js @@ -12,11 +12,16 @@ class D extends C { } //// [computedPropertyNames44_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/computedPropertyNames45_ES5.js b/tests/baselines/reference/computedPropertyNames45_ES5.js index 5b5d64f9bf024..7108935ab9e9d 100644 --- a/tests/baselines/reference/computedPropertyNames45_ES5.js +++ b/tests/baselines/reference/computedPropertyNames45_ES5.js @@ -13,11 +13,16 @@ class D extends C { } //// [computedPropertyNames45_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js index 408571af42aab..5c948261bb244 100644 --- a/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithIdenticalBCT.js @@ -48,11 +48,16 @@ var result11: any = true ? 1 : 'string'; //// [conditionalOperatorWithIdenticalBCT.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //Cond ? Expr1 : Expr2, Expr1 and Expr2 have identical best common type var X = (function () { function X() { diff --git a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js index 0ac935a582ad0..01b0fe327fa62 100644 --- a/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js +++ b/tests/baselines/reference/conditionalOperatorWithoutIdenticalBCT.js @@ -24,11 +24,16 @@ var result61: (t: X) => number| string = true ? (m) => m.propertyX1 : (n) => n.p //// [conditionalOperatorWithoutIdenticalBCT.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //Cond ? Expr1 : Expr2, Expr1 and Expr2 have no identical best common type var X = (function () { function X() { diff --git a/tests/baselines/reference/constantOverloadFunction.js b/tests/baselines/reference/constantOverloadFunction.js index 160191c5ca03d..e204db38c28d3 100644 --- a/tests/baselines/reference/constantOverloadFunction.js +++ b/tests/baselines/reference/constantOverloadFunction.js @@ -14,11 +14,16 @@ function foo(tagName: any): Base { //// [constantOverloadFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js index 509f9ba70e6c5..22ca8603ffb5d 100644 --- a/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js +++ b/tests/baselines/reference/constantOverloadFunctionNoSubtypeError.js @@ -15,11 +15,16 @@ function foo(tagName: any): Base { //// [constantOverloadFunctionNoSubtypeError.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js index 7908d36a56a44..074cfa49b4763 100644 --- a/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js +++ b/tests/baselines/reference/constraintCheckInGenericBaseTypeReference.js @@ -20,11 +20,16 @@ class Container { } //// [constraintCheckInGenericBaseTypeReference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // No errors var Constraint = (function () { function Constraint() { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js index 6b308d88896b5..53ba73b8ba924 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance2.js @@ -71,11 +71,16 @@ interface I extends A { //// [constructSignatureAssignabilityInInheritance2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js index 09abd6e0868e9..f6629487ff50f 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance3.js @@ -114,11 +114,16 @@ module Errors { //// [constructSignatureAssignabilityInInheritance3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js index 4e9a8c59bf994..3c20e2f96b57b 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance4.js @@ -61,11 +61,16 @@ interface I extends A { //// [constructSignatureAssignabilityInInheritance4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js index 91ec3b313bb0c..1d8efafc234d5 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance5.js @@ -51,11 +51,16 @@ interface I extends B { //// [constructSignatureAssignabilityInInheritance5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js index edafb00991681..f6436b7d3e2de 100644 --- a/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js +++ b/tests/baselines/reference/constructSignatureAssignabilityInInheritance6.js @@ -54,11 +54,16 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constructorArgs.js b/tests/baselines/reference/constructorArgs.js index 6bbea0fddf714..877cef3dd0a9e 100644 --- a/tests/baselines/reference/constructorArgs.js +++ b/tests/baselines/reference/constructorArgs.js @@ -16,11 +16,16 @@ class Sub extends Super { //// [constructorArgs.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Super = (function () { function Super(value) { } diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js index 45ed976e191c4..27ed085a00943 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType.js @@ -20,11 +20,16 @@ class Derived2 extends Base { } //// [constructorFunctionTypeIsAssignableToBaseType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js index c5e27748f5236..56891defbe031 100644 --- a/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js +++ b/tests/baselines/reference/constructorFunctionTypeIsAssignableToBaseType2.js @@ -34,11 +34,16 @@ class Derived2 extends Base { //// [constructorFunctionTypeIsAssignableToBaseType2.js] // the constructor function itself does not need to be a subtype of the base type constructor function -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { } diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index a16694cdbf54d..dae4e0bab23d8 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -32,11 +32,16 @@ module Generic { } //// [constructorHasPrototypeProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var NonGeneric; (function (NonGeneric) { var C = (function () { diff --git a/tests/baselines/reference/constructorOverloads2.js b/tests/baselines/reference/constructorOverloads2.js index 2d26194f2e764..291ea54573393 100644 --- a/tests/baselines/reference/constructorOverloads2.js +++ b/tests/baselines/reference/constructorOverloads2.js @@ -26,11 +26,16 @@ f1.bar1(); //// [constructorOverloads2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var FooBase = (function () { function FooBase(x) { } diff --git a/tests/baselines/reference/constructorOverloads3.js b/tests/baselines/reference/constructorOverloads3.js index c0ae9b452f98c..8ba67658a08e5 100644 --- a/tests/baselines/reference/constructorOverloads3.js +++ b/tests/baselines/reference/constructorOverloads3.js @@ -23,11 +23,16 @@ f1.bar1(); //// [constructorOverloads3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function (_super) { __extends(Foo, _super); function Foo(x, y) { diff --git a/tests/baselines/reference/constructorWithCapturedSuper.js b/tests/baselines/reference/constructorWithCapturedSuper.js index 895f78eb04b8b..503742de9fecc 100644 --- a/tests/baselines/reference/constructorWithCapturedSuper.js +++ b/tests/baselines/reference/constructorWithCapturedSuper.js @@ -53,11 +53,16 @@ class D extends A { } //// [constructorWithCapturedSuper.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var oneA; var A = (function () { function A() { diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js index d4cd737ab46f5..3193d69ed3ceb 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.js @@ -281,11 +281,16 @@ TypeScriptAllInOne.Program.Main(); //// [constructorWithIncompleteTypeAnnotation.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var fs = module; ("fs"); var TypeScriptAllInOne; diff --git a/tests/baselines/reference/contextualTypingArrayOfLambdas.js b/tests/baselines/reference/contextualTypingArrayOfLambdas.js index caf7ed445e566..4fda0eca21433 100644 --- a/tests/baselines/reference/contextualTypingArrayOfLambdas.js +++ b/tests/baselines/reference/contextualTypingArrayOfLambdas.js @@ -15,11 +15,16 @@ var xs = [(x: A) => { }, (x: B) => { }, (x: C) => { }]; //// [contextualTypingArrayOfLambdas.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression.js b/tests/baselines/reference/contextualTypingOfConditionalExpression.js index a6ce98f61e291..6e6ea60691c4d 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression.js @@ -15,11 +15,16 @@ var x2: (a: A) => void = true ? (a) => a.foo : (b) => b.foo; //// [contextualTypingOfConditionalExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x = true ? function (a) { return a.toExponential(); } : function (b) { return b.toFixed(); }; var A = (function () { function A() { diff --git a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js index e3bd1643cfb8e..0678ff5bf7421 100644 --- a/tests/baselines/reference/contextualTypingOfConditionalExpression2.js +++ b/tests/baselines/reference/contextualTypingOfConditionalExpression2.js @@ -13,11 +13,16 @@ var x2: (a: A) => void = true ? (a: C) => a.foo : (b: number) => { }; //// [contextualTypingOfConditionalExpression2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js index 89979da4812a4..b71997f21fe34 100644 --- a/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js +++ b/tests/baselines/reference/crashInsourcePropertyIsRelatableToTargetProperty.js @@ -11,11 +11,16 @@ var a: D = foo("hi", []); //// [crashInsourcePropertyIsRelatableToTargetProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.x = 1; diff --git a/tests/baselines/reference/declFileClassExtendsNull.js b/tests/baselines/reference/declFileClassExtendsNull.js index 30ddc3f08bf39..d46ff63f62a7e 100644 --- a/tests/baselines/reference/declFileClassExtendsNull.js +++ b/tests/baselines/reference/declFileClassExtendsNull.js @@ -4,11 +4,16 @@ class ExtendsNull extends null { } //// [declFileClassExtendsNull.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ExtendsNull = (function (_super) { __extends(ExtendsNull, _super); function ExtendsNull() { diff --git a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js index 442007d9b9a50..3d90e148d42e9 100644 --- a/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js +++ b/tests/baselines/reference/declFileForFunctionTypeAsTypeParameter.js @@ -10,11 +10,16 @@ interface I extends X<() => number> { //// [declFileForFunctionTypeAsTypeParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var X = (function () { function X() { } diff --git a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js index 47593dc9d6868..c2d7a1faf33e3 100644 --- a/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js +++ b/tests/baselines/reference/declFileGenericClassWithGenericExtendedClass.js @@ -13,11 +13,16 @@ class Baz implements IBar { //// [declFileGenericClassWithGenericExtendedClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/declFileGenericType.js b/tests/baselines/reference/declFileGenericType.js index b2e99a73ad762..8d7f16745c084 100644 --- a/tests/baselines/reference/declFileGenericType.js +++ b/tests/baselines/reference/declFileGenericType.js @@ -41,11 +41,16 @@ export var j = C.F6; //// [declFileGenericType.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C; (function (C) { var A = (function () { diff --git a/tests/baselines/reference/declFileGenericType2.js b/tests/baselines/reference/declFileGenericType2.js index 720be79b28d3c..1c6f2002da21c 100644 --- a/tests/baselines/reference/declFileGenericType2.js +++ b/tests/baselines/reference/declFileGenericType2.js @@ -43,11 +43,16 @@ module templa.dom.mvc.composite { //// [declFileGenericType2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Module var templa; (function (templa) { diff --git a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js index 17d885788dd34..da5177c89df40 100644 --- a/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js +++ b/tests/baselines/reference/declFileWithClassNameConflictingWithClassReferredByExtendsClause.js @@ -21,11 +21,16 @@ module X.Y.base.Z { //// [declFileWithClassNameConflictingWithClassReferredByExtendsClause.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var X; (function (X) { var Y; diff --git a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js index 70d0cd5a3dd51..a396c81c27fac 100644 --- a/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js +++ b/tests/baselines/reference/declFileWithExtendsClauseThatHasItsContainerNameConflict.js @@ -19,11 +19,16 @@ module A.B.C { } //// [declFileWithExtendsClauseThatHasItsContainerNameConflict.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A; (function (A) { var B; diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends.js b/tests/baselines/reference/declarationEmitExpressionInExtends.js index 726c7b22446c5..7a0fe6ed603e5 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends.js @@ -15,11 +15,16 @@ var q: B; q.s; //// [declarationEmitExpressionInExtends.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var Q = (function () { function Q() { diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends2.js b/tests/baselines/reference/declarationEmitExpressionInExtends2.js index 4081de6d3ed56..1df6168f09b38 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends2.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends2.js @@ -13,11 +13,16 @@ class MyClass extends getClass(2) { } //// [declarationEmitExpressionInExtends2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/declarationEmitExpressionInExtends3.js b/tests/baselines/reference/declarationEmitExpressionInExtends3.js index f36a7e250a29e..2a291f273dc32 100644 --- a/tests/baselines/reference/declarationEmitExpressionInExtends3.js +++ b/tests/baselines/reference/declarationEmitExpressionInExtends3.js @@ -45,11 +45,16 @@ export class MyClass4 extends getExportedClass(undefined)>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>var C = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(6, 1) Source(2, 1) + SourceIndex(0) +1 >Emitted(11, 1) Source(2, 1) + SourceIndex(0) --- >>> function C(value) { 1->^^^^ @@ -33,9 +38,9 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > 2 > constructor( 3 > value: number -1->Emitted(7, 5) Source(7, 5) + SourceIndex(0) -2 >Emitted(7, 16) Source(7, 17) + SourceIndex(0) -3 >Emitted(7, 21) Source(7, 30) + SourceIndex(0) +1->Emitted(12, 5) Source(7, 5) + SourceIndex(0) +2 >Emitted(12, 16) Source(7, 17) + SourceIndex(0) +3 >Emitted(12, 21) Source(7, 30) + SourceIndex(0) --- >>> this.cProp = 10; 1->^^^^^^^^ @@ -48,11 +53,11 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 3 > = 4 > 10 5 > ; -1->Emitted(8, 9) Source(3, 5) + SourceIndex(0) -2 >Emitted(8, 19) Source(3, 10) + SourceIndex(0) -3 >Emitted(8, 22) Source(3, 13) + SourceIndex(0) -4 >Emitted(8, 24) Source(3, 15) + SourceIndex(0) -5 >Emitted(8, 25) Source(3, 16) + SourceIndex(0) +1->Emitted(13, 9) Source(3, 5) + SourceIndex(0) +2 >Emitted(13, 19) Source(3, 10) + SourceIndex(0) +3 >Emitted(13, 22) Source(3, 13) + SourceIndex(0) +4 >Emitted(13, 24) Source(3, 15) + SourceIndex(0) +5 >Emitted(13, 25) Source(3, 16) + SourceIndex(0) --- >>> return { 1 >^^^^^^^^ @@ -67,9 +72,9 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > 2 > return 3 > -1 >Emitted(9, 9) Source(8, 9) + SourceIndex(0) -2 >Emitted(9, 15) Source(8, 15) + SourceIndex(0) -3 >Emitted(9, 16) Source(8, 16) + SourceIndex(0) +1 >Emitted(14, 9) Source(8, 9) + SourceIndex(0) +2 >Emitted(14, 15) Source(8, 15) + SourceIndex(0) +3 >Emitted(14, 16) Source(8, 16) + SourceIndex(0) --- >>> cProp: value, 1->^^^^^^^^^^^^ @@ -82,10 +87,10 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 > cProp 3 > : 4 > value -1->Emitted(10, 13) Source(9, 13) + SourceIndex(0) -2 >Emitted(10, 18) Source(9, 18) + SourceIndex(0) -3 >Emitted(10, 20) Source(9, 20) + SourceIndex(0) -4 >Emitted(10, 25) Source(9, 25) + SourceIndex(0) +1->Emitted(15, 13) Source(9, 13) + SourceIndex(0) +2 >Emitted(15, 18) Source(9, 18) + SourceIndex(0) +3 >Emitted(15, 20) Source(9, 20) + SourceIndex(0) +4 >Emitted(15, 25) Source(9, 25) + SourceIndex(0) --- >>> foo: function () { 1->^^^^^^^^^^^^ @@ -94,8 +99,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1->, > 2 > foo -1->Emitted(11, 13) Source(10, 13) + SourceIndex(0) -2 >Emitted(11, 16) Source(10, 16) + SourceIndex(0) +1->Emitted(16, 13) Source(10, 13) + SourceIndex(0) +2 >Emitted(16, 16) Source(10, 16) + SourceIndex(0) --- >>> return "well this looks kinda C-ish."; 1->^^^^^^^^^^^^^^^^ @@ -109,11 +114,11 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 3 > 4 > "well this looks kinda C-ish." 5 > ; -1->Emitted(12, 17) Source(11, 17) + SourceIndex(0) -2 >Emitted(12, 23) Source(11, 23) + SourceIndex(0) -3 >Emitted(12, 24) Source(11, 24) + SourceIndex(0) -4 >Emitted(12, 54) Source(11, 54) + SourceIndex(0) -5 >Emitted(12, 55) Source(11, 55) + SourceIndex(0) +1->Emitted(17, 17) Source(11, 17) + SourceIndex(0) +2 >Emitted(17, 23) Source(11, 23) + SourceIndex(0) +3 >Emitted(17, 24) Source(11, 24) + SourceIndex(0) +4 >Emitted(17, 54) Source(11, 54) + SourceIndex(0) +5 >Emitted(17, 55) Source(11, 55) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^ @@ -121,8 +126,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > 2 > } -1 >Emitted(13, 13) Source(12, 13) + SourceIndex(0) -2 >Emitted(13, 14) Source(12, 14) + SourceIndex(0) +1 >Emitted(18, 13) Source(12, 13) + SourceIndex(0) +2 >Emitted(18, 14) Source(12, 14) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^ @@ -130,8 +135,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > } 2 > -1 >Emitted(14, 10) Source(13, 10) + SourceIndex(0) -2 >Emitted(14, 11) Source(13, 10) + SourceIndex(0) +1 >Emitted(19, 10) Source(13, 10) + SourceIndex(0) +2 >Emitted(19, 11) Source(13, 10) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -140,8 +145,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > 2 > } -1 >Emitted(15, 5) Source(14, 5) + SourceIndex(0) -2 >Emitted(15, 6) Source(14, 6) + SourceIndex(0) +1 >Emitted(20, 5) Source(14, 5) + SourceIndex(0) +2 >Emitted(20, 6) Source(14, 6) + SourceIndex(0) --- >>> C.prototype.foo = function () { return "this never gets used."; }; 1->^^^^ @@ -164,16 +169,16 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 8 > ; 9 > 10> } -1->Emitted(16, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(16, 20) Source(5, 8) + SourceIndex(0) -3 >Emitted(16, 23) Source(5, 5) + SourceIndex(0) -4 >Emitted(16, 37) Source(5, 13) + SourceIndex(0) -5 >Emitted(16, 43) Source(5, 19) + SourceIndex(0) -6 >Emitted(16, 44) Source(5, 20) + SourceIndex(0) -7 >Emitted(16, 67) Source(5, 43) + SourceIndex(0) -8 >Emitted(16, 68) Source(5, 44) + SourceIndex(0) -9 >Emitted(16, 69) Source(5, 45) + SourceIndex(0) -10>Emitted(16, 70) Source(5, 46) + SourceIndex(0) +1->Emitted(21, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(21, 20) Source(5, 8) + SourceIndex(0) +3 >Emitted(21, 23) Source(5, 5) + SourceIndex(0) +4 >Emitted(21, 37) Source(5, 13) + SourceIndex(0) +5 >Emitted(21, 43) Source(5, 19) + SourceIndex(0) +6 >Emitted(21, 44) Source(5, 20) + SourceIndex(0) +7 >Emitted(21, 67) Source(5, 43) + SourceIndex(0) +8 >Emitted(21, 68) Source(5, 44) + SourceIndex(0) +9 >Emitted(21, 69) Source(5, 45) + SourceIndex(0) +10>Emitted(21, 70) Source(5, 46) + SourceIndex(0) --- >>> return C; 1 >^^^^ @@ -190,8 +195,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > } > 2 > } -1 >Emitted(17, 5) Source(15, 1) + SourceIndex(0) -2 >Emitted(17, 13) Source(15, 2) + SourceIndex(0) +1 >Emitted(22, 5) Source(15, 1) + SourceIndex(0) +2 >Emitted(22, 13) Source(15, 2) + SourceIndex(0) --- >>>}()); 1 > @@ -216,10 +221,10 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > } > } > } -1 >Emitted(18, 1) Source(15, 1) + SourceIndex(0) -2 >Emitted(18, 2) Source(15, 2) + SourceIndex(0) -3 >Emitted(18, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(18, 6) Source(15, 2) + SourceIndex(0) +1 >Emitted(23, 1) Source(15, 1) + SourceIndex(0) +2 >Emitted(23, 2) Source(15, 2) + SourceIndex(0) +3 >Emitted(23, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(23, 6) Source(15, 2) + SourceIndex(0) --- >>>var D = (function (_super) { 1-> @@ -227,15 +232,15 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1-> > > -1->Emitted(19, 1) Source(17, 1) + SourceIndex(0) +1->Emitted(24, 1) Source(17, 1) + SourceIndex(0) --- >>> __extends(D, _super); 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^ 1->class D extends 2 > C -1->Emitted(20, 5) Source(17, 17) + SourceIndex(0) -2 >Emitted(20, 26) Source(17, 18) + SourceIndex(0) +1->Emitted(25, 5) Source(17, 17) + SourceIndex(0) +2 >Emitted(25, 26) Source(17, 18) + SourceIndex(0) --- >>> function D(a) { 1 >^^^^ @@ -248,9 +253,9 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > 2 > constructor( 3 > a = 100 -1 >Emitted(21, 5) Source(20, 5) + SourceIndex(0) -2 >Emitted(21, 16) Source(20, 17) + SourceIndex(0) -3 >Emitted(21, 17) Source(20, 24) + SourceIndex(0) +1 >Emitted(26, 5) Source(20, 5) + SourceIndex(0) +2 >Emitted(26, 16) Source(20, 17) + SourceIndex(0) +3 >Emitted(26, 17) Source(20, 24) + SourceIndex(0) --- >>> if (a === void 0) { a = 100; } 1->^^^^^^^^ @@ -262,10 +267,10 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 > 3 > 4 > a = 100 -1->Emitted(22, 9) Source(20, 17) + SourceIndex(0) -2 >Emitted(22, 27) Source(20, 17) + SourceIndex(0) -3 >Emitted(22, 29) Source(20, 17) + SourceIndex(0) -4 >Emitted(22, 36) Source(20, 24) + SourceIndex(0) +1->Emitted(27, 9) Source(20, 17) + SourceIndex(0) +2 >Emitted(27, 27) Source(20, 17) + SourceIndex(0) +3 >Emitted(27, 29) Source(20, 17) + SourceIndex(0) +4 >Emitted(27, 36) Source(20, 24) + SourceIndex(0) --- >>> var _this = _super.call(this, a) || this; 1->^^^^^^^^ @@ -294,12 +299,12 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > else > return null; > } -1->Emitted(23, 9) Source(20, 5) + SourceIndex(0) -2 >Emitted(23, 21) Source(21, 9) + SourceIndex(0) -3 >Emitted(23, 39) Source(21, 15) + SourceIndex(0) -4 >Emitted(23, 40) Source(21, 16) + SourceIndex(0) -5 >Emitted(23, 41) Source(21, 17) + SourceIndex(0) -6 >Emitted(23, 50) Source(33, 6) + SourceIndex(0) +1->Emitted(28, 9) Source(20, 5) + SourceIndex(0) +2 >Emitted(28, 21) Source(21, 9) + SourceIndex(0) +3 >Emitted(28, 39) Source(21, 15) + SourceIndex(0) +4 >Emitted(28, 40) Source(21, 16) + SourceIndex(0) +5 >Emitted(28, 41) Source(21, 17) + SourceIndex(0) +6 >Emitted(28, 50) Source(33, 6) + SourceIndex(0) --- >>> _this.dProp = function () { return _this; }; 1->^^^^^^^^ @@ -320,15 +325,15 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 7 > 8 > this 9 > ; -1->Emitted(24, 9) Source(18, 5) + SourceIndex(0) -2 >Emitted(24, 20) Source(18, 10) + SourceIndex(0) -3 >Emitted(24, 23) Source(18, 13) + SourceIndex(0) -4 >Emitted(24, 37) Source(18, 19) + SourceIndex(0) -5 >Emitted(24, 44) Source(18, 19) + SourceIndex(0) -6 >Emitted(24, 49) Source(18, 23) + SourceIndex(0) -7 >Emitted(24, 51) Source(18, 19) + SourceIndex(0) -8 >Emitted(24, 52) Source(18, 23) + SourceIndex(0) -9 >Emitted(24, 53) Source(18, 24) + SourceIndex(0) +1->Emitted(29, 9) Source(18, 5) + SourceIndex(0) +2 >Emitted(29, 20) Source(18, 10) + SourceIndex(0) +3 >Emitted(29, 23) Source(18, 13) + SourceIndex(0) +4 >Emitted(29, 37) Source(18, 19) + SourceIndex(0) +5 >Emitted(29, 44) Source(18, 19) + SourceIndex(0) +6 >Emitted(29, 49) Source(18, 23) + SourceIndex(0) +7 >Emitted(29, 51) Source(18, 19) + SourceIndex(0) +8 >Emitted(29, 52) Source(18, 23) + SourceIndex(0) +9 >Emitted(29, 53) Source(18, 24) + SourceIndex(0) --- >>> if (Math.random() < 0.5) { 1 >^^^^^^^^ @@ -362,19 +367,19 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 11> ) 12> 13> { -1 >Emitted(25, 9) Source(23, 9) + SourceIndex(0) -2 >Emitted(25, 11) Source(23, 11) + SourceIndex(0) -3 >Emitted(25, 12) Source(23, 12) + SourceIndex(0) -4 >Emitted(25, 13) Source(23, 13) + SourceIndex(0) -5 >Emitted(25, 17) Source(23, 17) + SourceIndex(0) -6 >Emitted(25, 18) Source(23, 18) + SourceIndex(0) -7 >Emitted(25, 24) Source(23, 24) + SourceIndex(0) -8 >Emitted(25, 26) Source(23, 26) + SourceIndex(0) -9 >Emitted(25, 29) Source(23, 29) + SourceIndex(0) -10>Emitted(25, 32) Source(23, 32) + SourceIndex(0) -11>Emitted(25, 33) Source(23, 33) + SourceIndex(0) -12>Emitted(25, 34) Source(23, 34) + SourceIndex(0) -13>Emitted(25, 35) Source(23, 35) + SourceIndex(0) +1 >Emitted(30, 9) Source(23, 9) + SourceIndex(0) +2 >Emitted(30, 11) Source(23, 11) + SourceIndex(0) +3 >Emitted(30, 12) Source(23, 12) + SourceIndex(0) +4 >Emitted(30, 13) Source(23, 13) + SourceIndex(0) +5 >Emitted(30, 17) Source(23, 17) + SourceIndex(0) +6 >Emitted(30, 18) Source(23, 18) + SourceIndex(0) +7 >Emitted(30, 24) Source(23, 24) + SourceIndex(0) +8 >Emitted(30, 26) Source(23, 26) + SourceIndex(0) +9 >Emitted(30, 29) Source(23, 29) + SourceIndex(0) +10>Emitted(30, 32) Source(23, 32) + SourceIndex(0) +11>Emitted(30, 33) Source(23, 33) + SourceIndex(0) +12>Emitted(30, 34) Source(23, 34) + SourceIndex(0) +13>Emitted(30, 35) Source(23, 35) + SourceIndex(0) --- >>> "You win!"; 1 >^^^^^^^^^^^^ @@ -384,9 +389,9 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > 2 > "You win!" 3 > -1 >Emitted(26, 13) Source(24, 13) + SourceIndex(0) -2 >Emitted(26, 23) Source(24, 23) + SourceIndex(0) -3 >Emitted(26, 24) Source(24, 23) + SourceIndex(0) +1 >Emitted(31, 13) Source(24, 13) + SourceIndex(0) +2 >Emitted(31, 23) Source(24, 23) + SourceIndex(0) +3 >Emitted(31, 24) Source(24, 23) + SourceIndex(0) --- >>> return { 1 >^^^^^^^^^^^^ @@ -397,9 +402,9 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > 2 > return 3 > -1 >Emitted(27, 13) Source(25, 13) + SourceIndex(0) -2 >Emitted(27, 19) Source(25, 19) + SourceIndex(0) -3 >Emitted(27, 20) Source(25, 20) + SourceIndex(0) +1 >Emitted(32, 13) Source(25, 13) + SourceIndex(0) +2 >Emitted(32, 19) Source(25, 19) + SourceIndex(0) +3 >Emitted(32, 20) Source(25, 20) + SourceIndex(0) --- >>> cProp: 1, 1->^^^^^^^^^^^^^^^^ @@ -412,10 +417,10 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 2 > cProp 3 > : 4 > 1 -1->Emitted(28, 17) Source(26, 17) + SourceIndex(0) -2 >Emitted(28, 22) Source(26, 22) + SourceIndex(0) -3 >Emitted(28, 24) Source(26, 24) + SourceIndex(0) -4 >Emitted(28, 25) Source(26, 25) + SourceIndex(0) +1->Emitted(33, 17) Source(26, 17) + SourceIndex(0) +2 >Emitted(33, 22) Source(26, 22) + SourceIndex(0) +3 >Emitted(33, 24) Source(26, 24) + SourceIndex(0) +4 >Emitted(33, 25) Source(26, 25) + SourceIndex(0) --- >>> dProp: function () { return _this; }, 1->^^^^^^^^^^^^^^^^ @@ -436,14 +441,14 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 6 > this 7 > 8 > this -1->Emitted(29, 17) Source(27, 17) + SourceIndex(0) -2 >Emitted(29, 22) Source(27, 22) + SourceIndex(0) -3 >Emitted(29, 24) Source(27, 24) + SourceIndex(0) -4 >Emitted(29, 38) Source(27, 30) + SourceIndex(0) -5 >Emitted(29, 45) Source(27, 30) + SourceIndex(0) -6 >Emitted(29, 50) Source(27, 34) + SourceIndex(0) -7 >Emitted(29, 52) Source(27, 30) + SourceIndex(0) -8 >Emitted(29, 53) Source(27, 34) + SourceIndex(0) +1->Emitted(34, 17) Source(27, 17) + SourceIndex(0) +2 >Emitted(34, 22) Source(27, 22) + SourceIndex(0) +3 >Emitted(34, 24) Source(27, 24) + SourceIndex(0) +4 >Emitted(34, 38) Source(27, 30) + SourceIndex(0) +5 >Emitted(34, 45) Source(27, 30) + SourceIndex(0) +6 >Emitted(34, 50) Source(27, 34) + SourceIndex(0) +7 >Emitted(34, 52) Source(27, 30) + SourceIndex(0) +8 >Emitted(34, 53) Source(27, 34) + SourceIndex(0) --- >>> foo: function () { return "You win!!!!!"; } 1->^^^^^^^^^^^^^^^^ @@ -465,15 +470,15 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 7 > 8 > 9 > } -1->Emitted(30, 17) Source(28, 17) + SourceIndex(0) -2 >Emitted(30, 20) Source(28, 20) + SourceIndex(0) -3 >Emitted(30, 36) Source(28, 25) + SourceIndex(0) -4 >Emitted(30, 42) Source(28, 31) + SourceIndex(0) -5 >Emitted(30, 43) Source(28, 32) + SourceIndex(0) -6 >Emitted(30, 57) Source(28, 46) + SourceIndex(0) -7 >Emitted(30, 58) Source(28, 46) + SourceIndex(0) -8 >Emitted(30, 59) Source(28, 47) + SourceIndex(0) -9 >Emitted(30, 60) Source(28, 48) + SourceIndex(0) +1->Emitted(35, 17) Source(28, 17) + SourceIndex(0) +2 >Emitted(35, 20) Source(28, 20) + SourceIndex(0) +3 >Emitted(35, 36) Source(28, 25) + SourceIndex(0) +4 >Emitted(35, 42) Source(28, 31) + SourceIndex(0) +5 >Emitted(35, 43) Source(28, 32) + SourceIndex(0) +6 >Emitted(35, 57) Source(28, 46) + SourceIndex(0) +7 >Emitted(35, 58) Source(28, 46) + SourceIndex(0) +8 >Emitted(35, 59) Source(28, 47) + SourceIndex(0) +9 >Emitted(35, 60) Source(28, 48) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^ @@ -481,8 +486,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > } 2 > ; -1 >Emitted(31, 14) Source(29, 14) + SourceIndex(0) -2 >Emitted(31, 15) Source(29, 15) + SourceIndex(0) +1 >Emitted(36, 14) Source(29, 14) + SourceIndex(0) +2 >Emitted(36, 15) Source(29, 15) + SourceIndex(0) --- >>> } 1 >^^^^^^^^ @@ -491,8 +496,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > 2 > } -1 >Emitted(32, 9) Source(30, 9) + SourceIndex(0) -2 >Emitted(32, 10) Source(30, 10) + SourceIndex(0) +1 >Emitted(37, 9) Source(30, 9) + SourceIndex(0) +2 >Emitted(37, 10) Source(30, 10) + SourceIndex(0) --- >>> else 1->^^^^^^^^ @@ -501,8 +506,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1-> > 2 > else -1->Emitted(33, 9) Source(31, 9) + SourceIndex(0) -2 >Emitted(33, 13) Source(31, 13) + SourceIndex(0) +1->Emitted(38, 9) Source(31, 9) + SourceIndex(0) +2 >Emitted(38, 13) Source(31, 13) + SourceIndex(0) --- >>> return null; 1->^^^^^^^^^^^^ @@ -516,11 +521,11 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 3 > 4 > null 5 > ; -1->Emitted(34, 13) Source(32, 13) + SourceIndex(0) -2 >Emitted(34, 19) Source(32, 19) + SourceIndex(0) -3 >Emitted(34, 20) Source(32, 20) + SourceIndex(0) -4 >Emitted(34, 24) Source(32, 24) + SourceIndex(0) -5 >Emitted(34, 25) Source(32, 25) + SourceIndex(0) +1->Emitted(39, 13) Source(32, 13) + SourceIndex(0) +2 >Emitted(39, 19) Source(32, 19) + SourceIndex(0) +3 >Emitted(39, 20) Source(32, 20) + SourceIndex(0) +4 >Emitted(39, 24) Source(32, 24) + SourceIndex(0) +5 >Emitted(39, 25) Source(32, 25) + SourceIndex(0) --- >>> } 1 >^^^^ @@ -529,8 +534,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1 > > 2 > } -1 >Emitted(35, 5) Source(33, 5) + SourceIndex(0) -2 >Emitted(35, 6) Source(33, 6) + SourceIndex(0) +1 >Emitted(40, 5) Source(33, 5) + SourceIndex(0) +2 >Emitted(40, 6) Source(33, 6) + SourceIndex(0) --- >>> return D; 1->^^^^ @@ -538,8 +543,8 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts 1-> > 2 > } -1->Emitted(36, 5) Source(34, 1) + SourceIndex(0) -2 >Emitted(36, 13) Source(34, 2) + SourceIndex(0) +1->Emitted(41, 5) Source(34, 1) + SourceIndex(0) +2 >Emitted(41, 13) Source(34, 2) + SourceIndex(0) --- >>>}(C)); 1 > @@ -572,11 +577,11 @@ sourceFile:derivedClassConstructorWithExplicitReturns01.ts > return null; > } > } -1 >Emitted(37, 1) Source(34, 1) + SourceIndex(0) -2 >Emitted(37, 2) Source(34, 2) + SourceIndex(0) -3 >Emitted(37, 2) Source(17, 1) + SourceIndex(0) -4 >Emitted(37, 3) Source(17, 17) + SourceIndex(0) -5 >Emitted(37, 4) Source(17, 18) + SourceIndex(0) -6 >Emitted(37, 7) Source(34, 2) + SourceIndex(0) +1 >Emitted(42, 1) Source(34, 1) + SourceIndex(0) +2 >Emitted(42, 2) Source(34, 2) + SourceIndex(0) +3 >Emitted(42, 2) Source(17, 1) + SourceIndex(0) +4 >Emitted(42, 3) Source(17, 17) + SourceIndex(0) +5 >Emitted(42, 4) Source(17, 18) + SourceIndex(0) +6 >Emitted(42, 7) Source(34, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=derivedClassConstructorWithExplicitReturns01.js.map \ No newline at end of file diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index e76f3445c8eb2..51cca070d1fe4 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -34,11 +34,16 @@ class Derived4 extends Base2 { //// [derivedClassConstructorWithoutSuperCall.js] // derived class constructors must contain a super call -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js index 7f6b83593ca75..35dd1e197e28e 100644 --- a/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js +++ b/tests/baselines/reference/derivedClassFunctionOverridesBaseClassAccessor.js @@ -15,11 +15,16 @@ class Derived extends Base { } //// [derivedClassFunctionOverridesBaseClassAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js index 8224473cb548c..03310fcfc4c6a 100644 --- a/tests/baselines/reference/derivedClassIncludesInheritedMembers.js +++ b/tests/baselines/reference/derivedClassIncludesInheritedMembers.js @@ -41,11 +41,16 @@ var r8 = d2[1]; //// [derivedClassIncludesInheritedMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { } diff --git a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js index 4753e39539073..36ad6580c1867 100644 --- a/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js +++ b/tests/baselines/reference/derivedClassOverridesIndexersWithAssignmentCompatibility.js @@ -18,11 +18,16 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesIndexersWithAssignmentCompatibility.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js index 981c072d47c68..a7c35a96ac385 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js +++ b/tests/baselines/reference/derivedClassOverridesPrivateFunction1.js @@ -16,11 +16,16 @@ class DerivedClass extends BaseClass { new DerivedClass(); //// [derivedClassOverridesPrivateFunction1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseClass = (function () { function BaseClass() { this._init(); diff --git a/tests/baselines/reference/derivedClassOverridesPrivates.js b/tests/baselines/reference/derivedClassOverridesPrivates.js index 1a58c038feac6..c14783c83377e 100644 --- a/tests/baselines/reference/derivedClassOverridesPrivates.js +++ b/tests/baselines/reference/derivedClassOverridesPrivates.js @@ -16,11 +16,16 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesPrivates.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js index b8997769eb74c..9230a295f5bf4 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers.js @@ -37,11 +37,16 @@ class Derived extends Base { //// [derivedClassOverridesProtectedMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var y; var Base = (function () { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js index 6797eef0e7726..dc9059f956ee8 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers2.js @@ -64,11 +64,16 @@ var r8 = d2[1]; //// [derivedClassOverridesProtectedMembers2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var y; var Base = (function () { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js index d0d9d8fa0f58a..615bdcddcf052 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers3.js @@ -72,11 +72,16 @@ class Derived10 extends Base { } //// [derivedClassOverridesProtectedMembers3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var y; var Base = (function () { diff --git a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js index 06f809976008b..8e90218b06398 100644 --- a/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js +++ b/tests/baselines/reference/derivedClassOverridesProtectedMembers4.js @@ -15,11 +15,16 @@ class Derived2 extends Derived1 { } //// [derivedClassOverridesProtectedMembers4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var y; var Base = (function () { diff --git a/tests/baselines/reference/derivedClassOverridesPublicMembers.js b/tests/baselines/reference/derivedClassOverridesPublicMembers.js index 7943d904deafb..3bbd661c70496 100644 --- a/tests/baselines/reference/derivedClassOverridesPublicMembers.js +++ b/tests/baselines/reference/derivedClassOverridesPublicMembers.js @@ -63,11 +63,16 @@ var r8 = d2[1]; //// [derivedClassOverridesPublicMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x; var y; var Base = (function () { diff --git a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js index e42ff9c9e1d07..b53c736b8573a 100644 --- a/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js +++ b/tests/baselines/reference/derivedClassOverridesWithoutSubtype.js @@ -24,11 +24,16 @@ class Derived2 extends Base2 { } //// [derivedClassOverridesWithoutSubtype.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassParameterProperties.js b/tests/baselines/reference/derivedClassParameterProperties.js index 27dcc4b7d5dba..c127b1993efd0 100644 --- a/tests/baselines/reference/derivedClassParameterProperties.js +++ b/tests/baselines/reference/derivedClassParameterProperties.js @@ -96,11 +96,16 @@ class Derived10 extends Base2 { //// [derivedClassParameterProperties.js] // ordering of super calls in derived constructors matters depending on other class contents -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js index b778d7bbca281..92ef489cd4c32 100644 --- a/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js +++ b/tests/baselines/reference/derivedClassSuperCallsInNonConstructorMembers.js @@ -33,11 +33,16 @@ class Derived extends Base { //// [derivedClassSuperCallsInNonConstructorMembers.js] // error to use super calls outside a constructor -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js index 039e25919f8c9..f63a8076a0bab 100644 --- a/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js +++ b/tests/baselines/reference/derivedClassSuperCallsWithThisArg.js @@ -29,11 +29,16 @@ class Derived4 extends Base { } //// [derivedClassSuperCallsWithThisArg.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(a) { } diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index a76ac8101a098..2809d89935139 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -22,11 +22,16 @@ var r2 = e.foo(''); //// [derivedClassTransitivity.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index a3894863696b4..8b69ea00102ca 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -22,11 +22,16 @@ var r2 = e.foo(1, ''); //// [derivedClassTransitivity2.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index 71dfecb346f01..98e4bdd4b43aa 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -22,11 +22,16 @@ var r2 = e.foo('', 1); //// [derivedClassTransitivity3.js] // subclassing is not transitive when you can remove required parameters and add optional parameters -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedClassTransitivity4.js b/tests/baselines/reference/derivedClassTransitivity4.js index 0030ce702d82a..315d0322ed28a 100644 --- a/tests/baselines/reference/derivedClassTransitivity4.js +++ b/tests/baselines/reference/derivedClassTransitivity4.js @@ -22,11 +22,16 @@ var r2 = e.foo(''); //// [derivedClassTransitivity4.js] // subclassing is not transitive when you can remove required parameters and add optional parameters on protected members -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedClassWithAny.js b/tests/baselines/reference/derivedClassWithAny.js index 2a199e5586152..dd89a166cc106 100644 --- a/tests/baselines/reference/derivedClassWithAny.js +++ b/tests/baselines/reference/derivedClassWithAny.js @@ -60,11 +60,16 @@ var r = c.foo(); // e.foo would return string //// [derivedClassWithAny.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js index 0542815c4e4b7..c38b9b3bd0073 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingProtectedInstance.js @@ -23,11 +23,16 @@ class Derived extends Base { //// [derivedClassWithPrivateInstanceShadowingProtectedInstance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js index 41869cad416fd..a50008d414206 100644 --- a/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js +++ b/tests/baselines/reference/derivedClassWithPrivateInstanceShadowingPublicInstance.js @@ -33,11 +33,16 @@ var r6 = Derived.a; // error Derived.a = 2; // error //// [derivedClassWithPrivateInstanceShadowingPublicInstance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js index 10ae3cb35c855..1680b9178ff63 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingProtectedStatic.js @@ -22,11 +22,16 @@ class Derived extends Base { } //// [derivedClassWithPrivateStaticShadowingProtectedStatic.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js index 3f2c2a3b811a4..2b65181cea968 100644 --- a/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js +++ b/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.js @@ -34,11 +34,16 @@ var r6 = Derived.a; // error Derived.a = 2; // error //// [derivedClassWithPrivateStaticShadowingPublicStatic.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 7a6a7ecbb638b..ca746223e1be6 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -26,11 +26,16 @@ var d = new D(); // error var d2 = new D(new Date()); // ok //// [derivedClassWithoutExplicitConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { this.a = 1; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 62beb4bf28f65..492682b67bcc0 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -34,11 +34,16 @@ var d3 = new D(new Date(), new Date()); var d4 = new D(new Date(), new Date(), new Date()); //// [derivedClassWithoutExplicitConstructor2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { this.a = 1; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index c96d0c96723da..cf4d5cadecc5e 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -48,11 +48,16 @@ var d3 = new D2(new Date(), new Date()); // ok //// [derivedClassWithoutExplicitConstructor3.js] // automatic constructors with a class hieararchy of depth > 2 -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { this.a = 1; diff --git a/tests/baselines/reference/derivedClasses.js b/tests/baselines/reference/derivedClasses.js index 3e097a9b139c3..3bb1f7793efdb 100644 --- a/tests/baselines/reference/derivedClasses.js +++ b/tests/baselines/reference/derivedClasses.js @@ -31,11 +31,16 @@ b.hue(); //// [derivedClasses.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Red = (function (_super) { __extends(Red, _super); function Red() { diff --git a/tests/baselines/reference/derivedGenericClassWithAny.js b/tests/baselines/reference/derivedGenericClassWithAny.js index 1822f3fcc47dd..bab2879b229a3 100644 --- a/tests/baselines/reference/derivedGenericClassWithAny.js +++ b/tests/baselines/reference/derivedGenericClassWithAny.js @@ -43,11 +43,16 @@ c = e; var r = c.foo(); // e.foo would return string //// [derivedGenericClassWithAny.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index c17922e05eee0..9d076ad63a7aa 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -18,11 +18,16 @@ class Derived extends Base { } //// [derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js index 6fe690fd692db..faa148c65a5cc 100644 --- a/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js +++ b/tests/baselines/reference/derivedTypeDoesNotRequireExtendsClause.js @@ -21,11 +21,16 @@ b = d2; var r: Base[] = [d1, d2]; //// [derivedTypeDoesNotRequireExtendsClause.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/destructuringParameterDeclaration5.js b/tests/baselines/reference/destructuringParameterDeclaration5.js index 7ba178823df6f..d249952873591 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration5.js +++ b/tests/baselines/reference/destructuringParameterDeclaration5.js @@ -52,11 +52,16 @@ d3({ y: "world" }); //// [destructuringParameterDeclaration5.js] // Parameter Declaration with generic -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Class = (function () { function Class() { } diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js index 05b061116d3b4..3a8bbdb0c739e 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitParameterPropertyDeclaration1.js @@ -14,11 +14,16 @@ class B extends A { //// [emitSuperCallBeforeEmitParameterPropertyDeclaration1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.blub = 6; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js index 2cf2cb02073d6..d8145f6dc27f7 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclaration1.js @@ -16,11 +16,16 @@ class B extends A { } //// [emitSuperCallBeforeEmitPropertyDeclaration1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.blub = 6; diff --git a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js index eaa52e392853b..75c618d84dbb0 100644 --- a/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js +++ b/tests/baselines/reference/emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js @@ -14,11 +14,16 @@ class B extends A { } //// [emitSuperCallBeforeEmitPropertyDeclarationAndParameterPropertyDeclaration1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.blub = 6; diff --git a/tests/baselines/reference/emitThisInSuperMethodCall.js b/tests/baselines/reference/emitThisInSuperMethodCall.js index 1f7ed8bfa9443..16712fb82cf3b 100644 --- a/tests/baselines/reference/emitThisInSuperMethodCall.js +++ b/tests/baselines/reference/emitThisInSuperMethodCall.js @@ -28,11 +28,16 @@ class RegisteredUser extends User { //// [emitThisInSuperMethodCall.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var User = (function () { function User() { } diff --git a/tests/baselines/reference/emptyModuleName.js b/tests/baselines/reference/emptyModuleName.js index 3ed21cf217a64..7a22f87cfb486 100644 --- a/tests/baselines/reference/emptyModuleName.js +++ b/tests/baselines/reference/emptyModuleName.js @@ -5,11 +5,16 @@ class B extends A { //// [emptyModuleName.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = require(""); var B = (function (_super) { __extends(B, _super); diff --git a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js index ed2e1aa7f06e7..c5403b4d68578 100644 --- a/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js +++ b/tests/baselines/reference/errorForwardReferenceForwadingConstructor.js @@ -12,11 +12,16 @@ class derived extends base { } //// [errorForwardReferenceForwadingConstructor.js] // Error forward referencing derived class with forwarding constructor -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function f() { var d1 = new derived(); var d2 = new derived(4); diff --git a/tests/baselines/reference/errorSuperCalls.js b/tests/baselines/reference/errorSuperCalls.js index 720894e50c041..17a96d335f39c 100644 --- a/tests/baselines/reference/errorSuperCalls.js +++ b/tests/baselines/reference/errorSuperCalls.js @@ -75,11 +75,16 @@ class OtherDerived extends OtherBase { //// [errorSuperCalls.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //super call in class constructor with no base type var NoBase = (function () { function NoBase() { diff --git a/tests/baselines/reference/errorSuperPropertyAccess.js b/tests/baselines/reference/errorSuperPropertyAccess.js index e12a758b0537c..04ce626be322e 100644 --- a/tests/baselines/reference/errorSuperPropertyAccess.js +++ b/tests/baselines/reference/errorSuperPropertyAccess.js @@ -129,11 +129,16 @@ var obj = { n: super.wat, p: super.foo() }; //// [errorSuperPropertyAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //super property access in constructor of class with no base type //super property access in instance member function of class with no base type //super property access in instance member accessor(get and set) of class with no base type diff --git a/tests/baselines/reference/errorsInGenericTypeReference.js b/tests/baselines/reference/errorsInGenericTypeReference.js index 6dd9f62edcbc0..49ddbe58dacd1 100644 --- a/tests/baselines/reference/errorsInGenericTypeReference.js +++ b/tests/baselines/reference/errorsInGenericTypeReference.js @@ -73,11 +73,16 @@ interface testInterface2 { //// [errorsInGenericTypeReference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/es6ClassSuperCodegenBug.js b/tests/baselines/reference/es6ClassSuperCodegenBug.js index 2eec250211e98..c909a68ccf765 100644 --- a/tests/baselines/reference/es6ClassSuperCodegenBug.js +++ b/tests/baselines/reference/es6ClassSuperCodegenBug.js @@ -15,11 +15,16 @@ class B extends A { //// [es6ClassSuperCodegenBug.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(str1, str2) { } diff --git a/tests/baselines/reference/es6ClassTest.js b/tests/baselines/reference/es6ClassTest.js index 067e57c258186..9d66d2d8dc801 100644 --- a/tests/baselines/reference/es6ClassTest.js +++ b/tests/baselines/reference/es6ClassTest.js @@ -85,11 +85,16 @@ declare module AmbientMod { //// [es6ClassTest.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Bar = (function () { function Bar(n) { } diff --git a/tests/baselines/reference/es6ClassTest2.js b/tests/baselines/reference/es6ClassTest2.js index 533b332422d72..5133757348be2 100644 --- a/tests/baselines/reference/es6ClassTest2.js +++ b/tests/baselines/reference/es6ClassTest2.js @@ -159,11 +159,16 @@ var ccwc = new ChildClassWithoutConstructor(1, "s"); //// [es6ClassTest2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BasicMonster = (function () { function BasicMonster(name, health) { this.name = name; diff --git a/tests/baselines/reference/es6ClassTest7.js b/tests/baselines/reference/es6ClassTest7.js index f786fce446187..48937285684b7 100644 --- a/tests/baselines/reference/es6ClassTest7.js +++ b/tests/baselines/reference/es6ClassTest7.js @@ -9,11 +9,16 @@ class Bar extends M.Foo { //// [es6ClassTest7.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Bar = (function (_super) { __extends(Bar, _super); function Bar() { diff --git a/tests/baselines/reference/exportAssignmentOfGenericType1.js b/tests/baselines/reference/exportAssignmentOfGenericType1.js index 7c1831ecac487..f9ffa44e82cd5 100644 --- a/tests/baselines/reference/exportAssignmentOfGenericType1.js +++ b/tests/baselines/reference/exportAssignmentOfGenericType1.js @@ -24,11 +24,16 @@ define(["require", "exports"], function (require, exports) { return T; }); //// [exportAssignmentOfGenericType1_1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports", "exportAssignmentOfGenericType1_0"], function (require, exports, q) { "use strict"; var M = (function (_super) { diff --git a/tests/baselines/reference/exportDeclarationInInternalModule.js b/tests/baselines/reference/exportDeclarationInInternalModule.js index b6d6d982a3269..c1827d0df9e7e 100644 --- a/tests/baselines/reference/exportDeclarationInInternalModule.js +++ b/tests/baselines/reference/exportDeclarationInInternalModule.js @@ -19,11 +19,16 @@ var a: Bbb.SomeType; //// [exportDeclarationInInternalModule.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Bbb = (function () { function Bbb() { } diff --git a/tests/baselines/reference/extBaseClass1.js b/tests/baselines/reference/extBaseClass1.js index 91dfba7a9bf92..3424f39bd168f 100644 --- a/tests/baselines/reference/extBaseClass1.js +++ b/tests/baselines/reference/extBaseClass1.js @@ -20,11 +20,16 @@ module N { //// [extBaseClass1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var B = (function () { diff --git a/tests/baselines/reference/extBaseClass2.js b/tests/baselines/reference/extBaseClass2.js index 3ab217eb01979..ffc3249d7bf7f 100644 --- a/tests/baselines/reference/extBaseClass2.js +++ b/tests/baselines/reference/extBaseClass2.js @@ -11,11 +11,16 @@ module M { //// [extBaseClass2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var N; (function (N) { var C4 = (function (_super) { diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType.js b/tests/baselines/reference/extendAndImplementTheSameBaseType.js index 74bbf3a27ac93..ed5232d88c993 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType.js @@ -14,11 +14,16 @@ d.baz(); d.foo; //// [extendAndImplementTheSameBaseType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js index fa7963487d579..e9f37d718ff52 100644 --- a/tests/baselines/reference/extendAndImplementTheSameBaseType2.js +++ b/tests/baselines/reference/extendAndImplementTheSameBaseType2.js @@ -17,11 +17,16 @@ var r3: string = d.bar(); var r4: number = d.bar(); //// [extendAndImplementTheSameBaseType2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js index 596ab319b2ce8..3a755b0e6f616 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.js @@ -4,11 +4,16 @@ class derived extends base { } class base { constructor (public n: number) { } } //// [extendBaseClassBeforeItsDeclared.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var derived = (function (_super) { __extends(derived, _super); function derived() { diff --git a/tests/baselines/reference/extendClassExpressionFromModule.js b/tests/baselines/reference/extendClassExpressionFromModule.js index 895cdedfaff65..6e6943d5766bb 100644 --- a/tests/baselines/reference/extendClassExpressionFromModule.js +++ b/tests/baselines/reference/extendClassExpressionFromModule.js @@ -21,11 +21,16 @@ var x = (function () { module.exports = x; //// [foo2.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var foo1 = require("./foo1"); var x = foo1; var y = (function (_super) { diff --git a/tests/baselines/reference/extendConstructSignatureInInterface.js b/tests/baselines/reference/extendConstructSignatureInInterface.js index 4bf92dd0315d9..30c1151c33250 100644 --- a/tests/baselines/reference/extendConstructSignatureInInterface.js +++ b/tests/baselines/reference/extendConstructSignatureInInterface.js @@ -11,11 +11,16 @@ var e: E = new E(1); //// [extendConstructSignatureInInterface.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var CStatic; var E = (function (_super) { __extends(E, _super); diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index b23b601bc2902..066d19560b60a 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -4,11 +4,16 @@ var x = A; class C extends x { } // error, could not find symbol xs //// [extendNonClassSymbol1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index 78dfaa918277e..b82c3e2233bac 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -6,11 +6,16 @@ var x = new Foo(); // legal, considered a constructor function class C extends Foo {} // error, could not find symbol Foo //// [extendNonClassSymbol2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function Foo() { this.x = 1; } diff --git a/tests/baselines/reference/extendPrivateConstructorClass.js b/tests/baselines/reference/extendPrivateConstructorClass.js index 8893e9735ff1d..21968a3c47b15 100644 --- a/tests/baselines/reference/extendPrivateConstructorClass.js +++ b/tests/baselines/reference/extendPrivateConstructorClass.js @@ -10,11 +10,16 @@ class C extends abc.XYZ { //// [extendPrivateConstructorClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js index da081154d8a2e..b689e9b2640f2 100644 --- a/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js +++ b/tests/baselines/reference/extendingClassFromAliasAndUsageInIndexer.js @@ -42,11 +42,16 @@ var Model = (function () { exports.Model = Model; //// [extendingClassFromAliasAndUsageInIndexer_moduleA.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); @@ -58,11 +63,16 @@ var VisualizationModel = (function (_super) { exports.VisualizationModel = VisualizationModel; //// [extendingClassFromAliasAndUsageInIndexer_moduleB.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Backbone = require("./extendingClassFromAliasAndUsageInIndexer_backbone"); var VisualizationModel = (function (_super) { __extends(VisualizationModel, _super); diff --git a/tests/baselines/reference/extendsClauseAlreadySeen.js b/tests/baselines/reference/extendsClauseAlreadySeen.js index 267cd86eed09f..ec727e6b7575f 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen.js @@ -7,11 +7,16 @@ class D extends C extends C { } //// [extendsClauseAlreadySeen.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/extendsClauseAlreadySeen2.js b/tests/baselines/reference/extendsClauseAlreadySeen2.js index 76fbc3365af2f..7b960bb97ebc5 100644 --- a/tests/baselines/reference/extendsClauseAlreadySeen2.js +++ b/tests/baselines/reference/extendsClauseAlreadySeen2.js @@ -7,11 +7,16 @@ class D extends C extends C { } //// [extendsClauseAlreadySeen2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/fluentClasses.js b/tests/baselines/reference/fluentClasses.js index ac44416e13392..ae117674a8193 100644 --- a/tests/baselines/reference/fluentClasses.js +++ b/tests/baselines/reference/fluentClasses.js @@ -19,11 +19,16 @@ var z = c.foo().bar().baz(); // Fluent pattern //// [fluentClasses.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/for-inStatements.js b/tests/baselines/reference/for-inStatements.js index 15d771bf58767..44e7cf24bf4a4 100644 --- a/tests/baselines/reference/for-inStatements.js +++ b/tests/baselines/reference/for-inStatements.js @@ -81,11 +81,16 @@ for (var x in Color.Blue) { } //// [for-inStatements.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var aString; for (aString in {}) { } var anAny; diff --git a/tests/baselines/reference/for-inStatementsInvalid.js b/tests/baselines/reference/for-inStatementsInvalid.js index d1181760a367d..437e3fb9aef44 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.js +++ b/tests/baselines/reference/for-inStatementsInvalid.js @@ -64,11 +64,16 @@ for (var x in i[42]) { } //// [for-inStatementsInvalid.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var aNumber; for (aNumber in {}) { } var aBoolean; diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js index 3666ad930a6cc..ea3bee7b12b91 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.js +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.js @@ -55,11 +55,16 @@ for(var m: typeof M;;){} for( var m = M.A;;){} //// [forStatementsMultipleInvalidDecl.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/functionImplementationErrors.js b/tests/baselines/reference/functionImplementationErrors.js index 433418af41d22..4a64145181519 100644 --- a/tests/baselines/reference/functionImplementationErrors.js +++ b/tests/baselines/reference/functionImplementationErrors.js @@ -75,11 +75,16 @@ var f13 = () => { //// [functionImplementationErrors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // FunctionExpression with no return type annotation with multiple return statements with unrelated types var f1 = function () { return ''; diff --git a/tests/baselines/reference/functionImplementations.js b/tests/baselines/reference/functionImplementations.js index 86636b84a87b8..26468d8af8095 100644 --- a/tests/baselines/reference/functionImplementations.js +++ b/tests/baselines/reference/functionImplementations.js @@ -158,11 +158,16 @@ var f12: (x: number) => any = x => { // should be (x: number) => Base | AnotherC } //// [functionImplementations.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // FunctionExpression with no return type annotation and no return statement returns void var v = function () { }(); // FunctionExpression f with no return type annotation and directly references f in its body returns any diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs.js b/tests/baselines/reference/functionSubtypingOfVarArgs.js index 55917962184ef..83b889fa22bbb 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs.js @@ -15,11 +15,16 @@ class StringEvent extends EventBase { // should work //// [functionSubtypingOfVarArgs.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var EventBase = (function () { function EventBase() { this._listeners = []; diff --git a/tests/baselines/reference/functionSubtypingOfVarArgs2.js b/tests/baselines/reference/functionSubtypingOfVarArgs2.js index a676316459f93..bc49c602acb70 100644 --- a/tests/baselines/reference/functionSubtypingOfVarArgs2.js +++ b/tests/baselines/reference/functionSubtypingOfVarArgs2.js @@ -15,11 +15,16 @@ class StringEvent extends EventBase { //// [functionSubtypingOfVarArgs2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var EventBase = (function () { function EventBase() { this._listeners = []; diff --git a/tests/baselines/reference/generatedContextualTyping.js b/tests/baselines/reference/generatedContextualTyping.js index 2a6911d9cf539..782f3e985a16a 100644 --- a/tests/baselines/reference/generatedContextualTyping.js +++ b/tests/baselines/reference/generatedContextualTyping.js @@ -356,11 +356,16 @@ var x355 = function(n: (s: Base[]) => any) { }; x355(n => { var n: Base[]; retur var x356 = function(n: Genric) { }; x356({ func: n => { return [d1, d2]; } }); //// [generatedContextualTyping.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty.js b/tests/baselines/reference/genericBaseClassLiteralProperty.js index a075eff955014..35c31bb667755 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty.js @@ -13,11 +13,16 @@ class SubClass extends BaseClass { } //// [genericBaseClassLiteralProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseClass = (function () { function BaseClass() { } diff --git a/tests/baselines/reference/genericBaseClassLiteralProperty2.js b/tests/baselines/reference/genericBaseClassLiteralProperty2.js index 2b562742bf71c..8e91f9e228d22 100644 --- a/tests/baselines/reference/genericBaseClassLiteralProperty2.js +++ b/tests/baselines/reference/genericBaseClassLiteralProperty2.js @@ -16,11 +16,16 @@ class DataView2 extends BaseCollection2 { //// [genericBaseClassLiteralProperty2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var CollectionItem2 = (function () { function CollectionItem2() { } diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index afef6224ba15b..d7564d3e0523c 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -109,11 +109,16 @@ var r11 = i.foo8(); // Base //// [genericCallWithConstraintsTypeArgumentInference.js] // Basic type inference with generic calls and constraints, no errors expected -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 7b621b3ffd902..28c0fbcec7ed2 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -33,11 +33,16 @@ var i: I; var r4 = f2(i); // Base => Derived //// [genericCallWithObjectTypeArgs2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index 892cda0ee2d64..32e7bc1e74cf1 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -41,11 +41,16 @@ var r7 = f3(null, x => x); // any //// [genericCallWithObjectTypeArgsAndConstraints2.js] // Generic call with constraints infering type parameter from object member properties // No errors expected -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index addfbc756a8ed..f54727317e5aa 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -39,11 +39,16 @@ var r6 = f3(x => x, null); //// [genericCallWithObjectTypeArgsAndConstraints3.js] // Generic call with constraints infering type parameter from object member properties -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js index c2ad2ba29a395..cba1152fb0298 100644 --- a/tests/baselines/reference/genericCallbacksAndClassHierarchy.js +++ b/tests/baselines/reference/genericCallbacksAndClassHierarchy.js @@ -24,11 +24,16 @@ module M { } //// [genericCallbacksAndClassHierarchy.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var C1 = (function () { diff --git a/tests/baselines/reference/genericClassExpressionInFunction.js b/tests/baselines/reference/genericClassExpressionInFunction.js index dc574dedb0097..4125232241495 100644 --- a/tests/baselines/reference/genericClassExpressionInFunction.js +++ b/tests/baselines/reference/genericClassExpressionInFunction.js @@ -32,11 +32,16 @@ s.genericVar = 12; //// [genericClassExpressionInFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js index 1f3a6e17f1410..d91a43805e30a 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.js @@ -6,11 +6,16 @@ class C { } //// [genericClassInheritsConstructorFromNonGenericClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function (_super) { __extends(A, _super); function A() { diff --git a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js index 28eaf46496807..b5c8f47bfd4b2 100644 --- a/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js +++ b/tests/baselines/reference/genericClassPropertyInheritanceSpecialization.js @@ -76,11 +76,16 @@ class ViewModel implements Contract { //// [genericClassPropertyInheritanceSpecialization.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Portal; (function (Portal) { var Controls; diff --git a/tests/baselines/reference/genericClassStaticMethod.js b/tests/baselines/reference/genericClassStaticMethod.js index 4609e3bc9db45..ea236e402034d 100644 --- a/tests/baselines/reference/genericClassStaticMethod.js +++ b/tests/baselines/reference/genericClassStaticMethod.js @@ -11,11 +11,16 @@ class Bar extends Foo { //// [genericClassStaticMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 5371e2479aad0..94c22c1241f4f 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -18,11 +18,16 @@ var z = v2.b; //// [genericClasses3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js index d990f76d2c3c3..c66279ec8734e 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes.js @@ -27,11 +27,16 @@ module EndGate.Tweening { } //// [genericConstraintOnExtendedBuiltinTypes.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var EndGate; (function (EndGate) { var Tweening; diff --git a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js index 4291b315933b9..af5f46c3c57cc 100644 --- a/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js +++ b/tests/baselines/reference/genericConstraintOnExtendedBuiltinTypes2.js @@ -26,11 +26,16 @@ module EndGate.Tweening { } //// [genericConstraintOnExtendedBuiltinTypes2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var EndGate; (function (EndGate) { var Tweening; diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js index 1b455073196dd..1e231a172c3b1 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase.js @@ -13,11 +13,16 @@ x = y; // error //// [genericDerivedTypeWithSpecializedBase.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js index 0abd655e1daaa..2438206cbf29a 100644 --- a/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js +++ b/tests/baselines/reference/genericDerivedTypeWithSpecializedBase2.js @@ -13,11 +13,16 @@ x = y; // error //// [genericDerivedTypeWithSpecializedBase2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericInheritedDefaultConstructors.js b/tests/baselines/reference/genericInheritedDefaultConstructors.js index 059a3213b7aa0..6d4112fb6666c 100644 --- a/tests/baselines/reference/genericInheritedDefaultConstructors.js +++ b/tests/baselines/reference/genericInheritedDefaultConstructors.js @@ -11,11 +11,16 @@ var c:Constructor> = B; // shouldn't error here //// [genericInheritedDefaultConstructors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericPrototypeProperty2.js b/tests/baselines/reference/genericPrototypeProperty2.js index eac025cce9ba9..dd494b1bdcdac 100644 --- a/tests/baselines/reference/genericPrototypeProperty2.js +++ b/tests/baselines/reference/genericPrototypeProperty2.js @@ -16,11 +16,16 @@ class MyEventWrapper extends BaseEventWrapper { } //// [genericPrototypeProperty2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseEvent = (function () { function BaseEvent() { } diff --git a/tests/baselines/reference/genericPrototypeProperty3.js b/tests/baselines/reference/genericPrototypeProperty3.js index 9e3ede0019d03..45e39d173a19d 100644 --- a/tests/baselines/reference/genericPrototypeProperty3.js +++ b/tests/baselines/reference/genericPrototypeProperty3.js @@ -15,11 +15,16 @@ class MyEventWrapper extends BaseEventWrapper { } //// [genericPrototypeProperty3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseEvent = (function () { function BaseEvent() { } diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js index 401a2e94b6819..558f6034b1671 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors2.js @@ -27,11 +27,16 @@ module TypeScript2 { //// [genericRecursiveImplicitConstructorErrors2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var TypeScript2; (function (TypeScript2) { ; diff --git a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js index c7643d4a9a265..bea6d81dbaaec 100644 --- a/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js +++ b/tests/baselines/reference/genericRecursiveImplicitConstructorErrors3.js @@ -31,11 +31,16 @@ module TypeScript { //// [genericRecursiveImplicitConstructorErrors3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var TypeScript; (function (TypeScript) { var MemberName = (function () { diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 687d593f01e12..bcdaaa3958b37 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -14,11 +14,16 @@ var r4: A = >new A(); var r5: A = >[]; // error //// [genericTypeAssertions2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericTypeAssertions4.js b/tests/baselines/reference/genericTypeAssertions4.js index 50dbe5debbd9a..a2a7548bb6325 100644 --- a/tests/baselines/reference/genericTypeAssertions4.js +++ b/tests/baselines/reference/genericTypeAssertions4.js @@ -26,11 +26,16 @@ function foo2(x: T) { } //// [genericTypeAssertions4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/genericTypeAssertions6.js b/tests/baselines/reference/genericTypeAssertions6.js index 7bbd7351f1dd4..cdeb709fdfbc8 100644 --- a/tests/baselines/reference/genericTypeAssertions6.js +++ b/tests/baselines/reference/genericTypeAssertions6.js @@ -25,11 +25,16 @@ var b: B; var c: A = >b; //// [genericTypeAssertions6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(x) { var y = x; diff --git a/tests/baselines/reference/genericTypeConstraints.js b/tests/baselines/reference/genericTypeConstraints.js index 67303166aa327..cbb03b683a82a 100644 --- a/tests/baselines/reference/genericTypeConstraints.js +++ b/tests/baselines/reference/genericTypeConstraints.js @@ -14,11 +14,16 @@ class BarExtended extends Bar { } //// [genericTypeConstraints.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js index cf19feede3436..8704103d530d1 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument.js @@ -40,11 +40,16 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument.js] // it is an error to use a generic type without type arguments // all of these are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js index 973ee23176282..75317fe0c8175 100644 --- a/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js +++ b/tests/baselines/reference/genericTypeReferenceWithoutTypeArgument2.js @@ -40,11 +40,16 @@ var k = null; //// [genericTypeReferenceWithoutTypeArgument2.js] // it is an error to use a generic type without type arguments // all of these are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var c; var a; var b; diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js index d6fb98b67cae0..f91d9b5d6cf25 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType2.js @@ -15,11 +15,16 @@ export class ListItem extends CollectionItem { //// [genericWithIndexerOfTypeParameterType2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports"], function (require, exports) { "use strict"; var Collection = (function () { diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index 9b15cf743f0c8..e15125ed70e17 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -133,11 +133,16 @@ function foo4(t: T, u: U) { //// [heterogeneousArrayLiterals.js] // type of an array is the best common type of its elements (plus its contextual type if it exists) -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = [1, '']; // {}[] var b = [1, null]; // number[] var c = [1, '', null]; // {}[] diff --git a/tests/baselines/reference/ifDoWhileStatements.js b/tests/baselines/reference/ifDoWhileStatements.js index 483370bee5c5c..83e4017743450 100644 --- a/tests/baselines/reference/ifDoWhileStatements.js +++ b/tests/baselines/reference/ifDoWhileStatements.js @@ -164,11 +164,16 @@ do { }while(fn) //// [ifDoWhileStatements.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/illegalSuperCallsInConstructor.js b/tests/baselines/reference/illegalSuperCallsInConstructor.js index 868d53daad54b..7e138dbf4a10c 100644 --- a/tests/baselines/reference/illegalSuperCallsInConstructor.js +++ b/tests/baselines/reference/illegalSuperCallsInConstructor.js @@ -21,11 +21,16 @@ class Derived extends Base { } //// [illegalSuperCallsInConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/implementClausePrecedingExtends.js b/tests/baselines/reference/implementClausePrecedingExtends.js index df725cde43a08..20a95fbcdc8fe 100644 --- a/tests/baselines/reference/implementClausePrecedingExtends.js +++ b/tests/baselines/reference/implementClausePrecedingExtends.js @@ -3,11 +3,16 @@ class C { foo: number } class D implements C extends C { } //// [implementClausePrecedingExtends.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index a5a5e02c15675..07819ad752c70 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -86,11 +86,16 @@ module M2 { } //// [implementingAnInterfaceExtendingClassWithPrivates2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js index d0f7484714164..d79ae31ac25f9 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithProtecteds.js @@ -42,11 +42,16 @@ class Bar8 extends Foo implements I { //// [implementingAnInterfaceExtendingClassWithProtecteds.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/importAsBaseClass.js b/tests/baselines/reference/importAsBaseClass.js index b4f45cac8067a..290e331b3f108 100644 --- a/tests/baselines/reference/importAsBaseClass.js +++ b/tests/baselines/reference/importAsBaseClass.js @@ -21,11 +21,16 @@ var Greeter = (function () { exports.Greeter = Greeter; //// [importAsBaseClass_1.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Greeter = require("./importAsBaseClass_0"); var Hello = (function (_super) { __extends(Hello, _super); diff --git a/tests/baselines/reference/importHelpers.js b/tests/baselines/reference/importHelpers.js index 762f0778945ea..571bdb4fa4b5a 100644 --- a/tests/baselines/reference/importHelpers.js +++ b/tests/baselines/reference/importHelpers.js @@ -67,11 +67,16 @@ C = tslib_1.__decorate([ dec ], C); //// [script.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/importHelpersNoHelpers.js b/tests/baselines/reference/importHelpersNoHelpers.js index 560e16d1cca96..832cfeaf5191b 100644 --- a/tests/baselines/reference/importHelpersNoHelpers.js +++ b/tests/baselines/reference/importHelpersNoHelpers.js @@ -69,11 +69,16 @@ var o = { a: 1 }; var y = tslib_1.__assign({}, o); var x = tslib_1.__rest(y, []); //// [script.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/importHelpersNoModule.js b/tests/baselines/reference/importHelpersNoModule.js index 65a004eb66c98..bd658b703f136 100644 --- a/tests/baselines/reference/importHelpersNoModule.js +++ b/tests/baselines/reference/importHelpersNoModule.js @@ -59,11 +59,16 @@ C = tslib_1.__decorate([ dec ], C); //// [script.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); diff --git a/tests/baselines/reference/importShadowsGlobalName.js b/tests/baselines/reference/importShadowsGlobalName.js index 34cc0604e7ae9..cb3f037832859 100644 --- a/tests/baselines/reference/importShadowsGlobalName.js +++ b/tests/baselines/reference/importShadowsGlobalName.js @@ -21,11 +21,16 @@ define(["require", "exports"], function (require, exports) { return Foo; }); //// [Bar.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports", "Foo"], function (require, exports, Error) { "use strict"; var Bar = (function (_super) { diff --git a/tests/baselines/reference/importUsedInExtendsList1.js b/tests/baselines/reference/importUsedInExtendsList1.js index a40c3a51a782b..c19e5be7e13fe 100644 --- a/tests/baselines/reference/importUsedInExtendsList1.js +++ b/tests/baselines/reference/importUsedInExtendsList1.js @@ -21,11 +21,16 @@ var Super = (function () { exports.Super = Super; //// [importUsedInExtendsList1_1.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var foo = require("./importUsedInExtendsList1_require"); var Sub = (function (_super) { diff --git a/tests/baselines/reference/indexerConstraints2.js b/tests/baselines/reference/indexerConstraints2.js index d7357f021d0ed..2dfc6d69e0653 100644 --- a/tests/baselines/reference/indexerConstraints2.js +++ b/tests/baselines/reference/indexerConstraints2.js @@ -29,11 +29,16 @@ class K extends J { } //// [indexerConstraints2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/indirectSelfReference.js b/tests/baselines/reference/indirectSelfReference.js index 2f4f37b9b53a5..d912f07c145c2 100644 --- a/tests/baselines/reference/indirectSelfReference.js +++ b/tests/baselines/reference/indirectSelfReference.js @@ -3,11 +3,16 @@ class a extends b{ } class b extends a{ } //// [indirectSelfReference.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function (_super) { __extends(a, _super); function a() { diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.js b/tests/baselines/reference/indirectSelfReferenceGeneric.js index 9171bb0eeb6ee..7c362a384aafc 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.js +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.js @@ -3,11 +3,16 @@ class a extends b { } class b extends a { } //// [indirectSelfReferenceGeneric.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function (_super) { __extends(a, _super); function a() { diff --git a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js index ad1a063bfb0fd..4589d2d967182 100644 --- a/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js +++ b/tests/baselines/reference/infinitelyExpandingTypesNonGenericBase.js @@ -25,11 +25,16 @@ o(A); //// [infinitelyExpandingTypesNonGenericBase.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Functionality = (function () { function Functionality() { } diff --git a/tests/baselines/reference/inheritFromGenericTypeParameter.js b/tests/baselines/reference/inheritFromGenericTypeParameter.js index 40e6abd3e5366..4e58f0b490d99 100644 --- a/tests/baselines/reference/inheritFromGenericTypeParameter.js +++ b/tests/baselines/reference/inheritFromGenericTypeParameter.js @@ -3,11 +3,16 @@ class C extends T { } interface I extends T { } //// [inheritFromGenericTypeParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js index a0874eb1c723f..15cdaba7d01d3 100644 --- a/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js +++ b/tests/baselines/reference/inheritSameNamePrivatePropertiesFromSameOrigin.js @@ -11,11 +11,16 @@ interface A extends C, C2 { // ok } //// [inheritSameNamePrivatePropertiesFromSameOrigin.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/inheritance.js b/tests/baselines/reference/inheritance.js index cbfef2d3382a4..72fa6c80a811c 100644 --- a/tests/baselines/reference/inheritance.js +++ b/tests/baselines/reference/inheritance.js @@ -35,11 +35,16 @@ class Baad extends Good { //// [inheritance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B1 = (function () { function B1() { } diff --git a/tests/baselines/reference/inheritance1.js b/tests/baselines/reference/inheritance1.js index 86de0b7635066..b3d87d0452fa4 100644 --- a/tests/baselines/reference/inheritance1.js +++ b/tests/baselines/reference/inheritance1.js @@ -62,11 +62,16 @@ l1 = sc; l1 = c; //// [inheritance1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Control = (function () { function Control() { } diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js index 57a9c89758357..5c1568663dc4f 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollision.js @@ -11,11 +11,16 @@ class C extends B { //// [inheritanceGrandParentPrivateMemberCollision.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js index 83c5aa3e4cdfc..f35305b2bcccf 100644 --- a/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js @@ -11,11 +11,16 @@ class C extends B { //// [inheritanceGrandParentPrivateMemberCollisionWithPublicMember.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js index b11b6e318a7cb..8a6de50ee60be 100644 --- a/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js +++ b/tests/baselines/reference/inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js @@ -11,11 +11,16 @@ class C extends B { //// [inheritanceGrandParentPublicMemberCollisionWithPrivateMember.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js index 09ea08899d9dd..be1cecd939d2c 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingAccessor.js @@ -18,11 +18,16 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js index 59d2abdaab2b5..76829925c62f4 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingMethod.js @@ -15,11 +15,16 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js index 98a95747a8e8b..fff0dd7b83271 100644 --- a/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberAccessorOverridingProperty.js @@ -13,11 +13,16 @@ class b extends a { } //// [inheritanceMemberAccessorOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js index 0d54e5d42fab9..085b3966541b7 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.js @@ -15,11 +15,16 @@ class b extends a { } //// [inheritanceMemberFuncOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js index 9af25c6fdb807..fc405638f0fe2 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingMethod.js @@ -12,11 +12,16 @@ class b extends a { } //// [inheritanceMemberFuncOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js index 5c77ce081010d..94ea69a7fba6c 100644 --- a/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberFuncOverridingProperty.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceMemberFuncOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js index 82c7a94d17c77..866323cd2044c 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingAccessor.js @@ -14,11 +14,16 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js index e6929218e6396..fe8c045724041 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingMethod.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js index 85764cddc5230..e431d295d015c 100644 --- a/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceMemberPropertyOverridingProperty.js @@ -8,11 +8,16 @@ class b extends a { } //// [inheritanceMemberPropertyOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index 28fe814450996..1e1a7c69a08a9 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -8,11 +8,16 @@ var b3 = new B(); // error, could not select overload for 'new' expression //// [inheritanceOfGenericConstructorMethod1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 0cc71e168f4a8..01370a3183c61 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -15,11 +15,16 @@ var n3 = new N.D2(); // no error, D2 //// [inheritanceOfGenericConstructorMethod2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var C1 = (function () { diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js index bb91ee5f9ead4..bff113f80e3b7 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingAccessor.js @@ -18,11 +18,16 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js index 363852a84bf49..773f97c2bc981 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingMethod.js @@ -15,11 +15,16 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js index ba8df7a5f0bca..73eb1021d6212 100644 --- a/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticAccessorOverridingProperty.js @@ -13,11 +13,16 @@ class b extends a { } //// [inheritanceStaticAccessorOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js index e464029fba5d9..8d2aab0bbd1eb 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessor.js @@ -15,11 +15,16 @@ class b extends a { } //// [inheritanceStaticFuncOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js index cc825cfa9b5e8..c41281eecc417 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingAccessorOfFuncType.js @@ -12,11 +12,16 @@ class b extends a { } //// [inheritanceStaticFuncOverridingAccessorOfFuncType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js index 466c65fa7d5b1..cdbc3913a220a 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingMethod.js @@ -12,11 +12,16 @@ class b extends a { } //// [inheritanceStaticFuncOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js index dfc0ce2c13fcd..77a8e21dc74d9 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingProperty.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceStaticFuncOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js index da7850f2071fd..0f0eb43fdd63e 100644 --- a/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js +++ b/tests/baselines/reference/inheritanceStaticFuncOverridingPropertyOfFuncType.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceStaticFuncOverridingPropertyOfFuncType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js index d5916a9d452c1..fd92a88721907 100644 --- a/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js +++ b/tests/baselines/reference/inheritanceStaticFunctionOverridingInstanceProperty.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceStaticFunctionOverridingInstanceProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticMembersCompatible.js b/tests/baselines/reference/inheritanceStaticMembersCompatible.js index b4cae99b64be9..7a74aea52d69b 100644 --- a/tests/baselines/reference/inheritanceStaticMembersCompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersCompatible.js @@ -8,11 +8,16 @@ class b extends a { } //// [inheritanceStaticMembersCompatible.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js index 38c637dd8d1b0..f18058113453d 100644 --- a/tests/baselines/reference/inheritanceStaticMembersIncompatible.js +++ b/tests/baselines/reference/inheritanceStaticMembersIncompatible.js @@ -8,11 +8,16 @@ class b extends a { } //// [inheritanceStaticMembersIncompatible.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js index 49dc86fc50036..435bf6d0a8de5 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingAccessor.js @@ -13,11 +13,16 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js index bcd63537540d8..ee69b89dd4c73 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingMethod.js @@ -10,11 +10,16 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js index c1bdd9b66a234..7fd7cca98c427 100644 --- a/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js +++ b/tests/baselines/reference/inheritanceStaticPropertyOverridingProperty.js @@ -8,11 +8,16 @@ class b extends a { } //// [inheritanceStaticPropertyOverridingProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = (function () { function a() { } diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams.js b/tests/baselines/reference/inheritedConstructorWithRestParams.js index 6a30836d72896..a11136ba6b7bc 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams.js @@ -15,11 +15,16 @@ new Derived("", 3); new Derived(3); //// [inheritedConstructorWithRestParams.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { var a = []; diff --git a/tests/baselines/reference/inheritedConstructorWithRestParams2.js b/tests/baselines/reference/inheritedConstructorWithRestParams2.js index 9a1b13a84348c..7d06886f56265 100644 --- a/tests/baselines/reference/inheritedConstructorWithRestParams2.js +++ b/tests/baselines/reference/inheritedConstructorWithRestParams2.js @@ -35,11 +35,16 @@ new Derived("", 3, "", 3); new Derived("", 3, "", ""); //// [inheritedConstructorWithRestParams2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var IBaseBase = (function () { function IBaseBase(x) { } diff --git a/tests/baselines/reference/inheritedModuleMembersForClodule.js b/tests/baselines/reference/inheritedModuleMembersForClodule.js index cd49009fed990..3a20f4313b645 100644 --- a/tests/baselines/reference/inheritedModuleMembersForClodule.js +++ b/tests/baselines/reference/inheritedModuleMembersForClodule.js @@ -22,11 +22,16 @@ class E extends D { //// [inheritedModuleMembersForClodule.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/instanceOfAssignability.js b/tests/baselines/reference/instanceOfAssignability.js index b8f39c5b0e21a..a0b15b0e287c9 100644 --- a/tests/baselines/reference/instanceOfAssignability.js +++ b/tests/baselines/reference/instanceOfAssignability.js @@ -90,11 +90,16 @@ function fn8(x: Alpha|Beta|Gamma) { //// [instanceOfAssignability.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Derived1 is assignable to, but not a subtype of, Base var Derived1 = (function () { function Derived1() { diff --git a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js index 8dc5227685f76..b80c8f0ff13b5 100644 --- a/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js +++ b/tests/baselines/reference/instancePropertiesInheritedIntoClassType.js @@ -43,11 +43,16 @@ module Generic { } //// [instancePropertiesInheritedIntoClassType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var NonGeneric; (function (NonGeneric) { var C = (function () { diff --git a/tests/baselines/reference/instanceSubtypeCheck2.js b/tests/baselines/reference/instanceSubtypeCheck2.js index 914f37960012e..c42f071ddb93a 100644 --- a/tests/baselines/reference/instanceSubtypeCheck2.js +++ b/tests/baselines/reference/instanceSubtypeCheck2.js @@ -8,11 +8,16 @@ class C2 extends C1 { } //// [instanceSubtypeCheck2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js index 54a574238e562..32c156749844b 100644 --- a/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js +++ b/tests/baselines/reference/instanceofWithStructurallyIdenticalTypes.js @@ -72,11 +72,16 @@ function goo(x: A) { //// [instanceofWithStructurallyIdenticalTypes.js] // Repro from #7271 -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/instantiatedReturnTypeContravariance.js b/tests/baselines/reference/instantiatedReturnTypeContravariance.js index bc496a63632d3..7eed6d7f5fcfd 100644 --- a/tests/baselines/reference/instantiatedReturnTypeContravariance.js +++ b/tests/baselines/reference/instantiatedReturnTypeContravariance.js @@ -31,11 +31,16 @@ return null; //// [instantiatedReturnTypeContravariance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var c = (function () { function c() { } diff --git a/tests/baselines/reference/interfaceClassMerging.js b/tests/baselines/reference/interfaceClassMerging.js index 6542376a19bde..4cca8c1c8b9eb 100644 --- a/tests/baselines/reference/interfaceClassMerging.js +++ b/tests/baselines/reference/interfaceClassMerging.js @@ -41,11 +41,16 @@ obj = bar; //// [interfaceClassMerging.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/interfaceClassMerging2.js b/tests/baselines/reference/interfaceClassMerging2.js index 70a62da4131ed..8d860ae95e728 100644 --- a/tests/baselines/reference/interfaceClassMerging2.js +++ b/tests/baselines/reference/interfaceClassMerging2.js @@ -37,11 +37,16 @@ foo = bar; //// [interfaceClassMerging2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/interfaceExtendsClass1.js b/tests/baselines/reference/interfaceExtendsClass1.js index 8324a001f9146..fc5afcdddacdf 100644 --- a/tests/baselines/reference/interfaceExtendsClass1.js +++ b/tests/baselines/reference/interfaceExtendsClass1.js @@ -19,11 +19,16 @@ class Location { //// [interfaceExtendsClass1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Control = (function () { function Control() { } diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js index 1179ff101df0b..334ac5cd29228 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate1.js @@ -28,11 +28,16 @@ c = d; d = c; // error //// [interfaceExtendsClassWithPrivate1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.x = 1; diff --git a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js index 49b5efbd01268..cc3e8163d1807 100644 --- a/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js +++ b/tests/baselines/reference/interfaceExtendsClassWithPrivate2.js @@ -24,11 +24,16 @@ class D2 extends C implements I { // error } //// [interfaceExtendsClassWithPrivate2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.x = 1; diff --git a/tests/baselines/reference/interfaceImplementation8.js b/tests/baselines/reference/interfaceImplementation8.js index afb5a795264cc..aa9bf7b4cf87d 100644 --- a/tests/baselines/reference/interfaceImplementation8.js +++ b/tests/baselines/reference/interfaceImplementation8.js @@ -41,11 +41,16 @@ class C8 extends C7 implements i2{ //// [interfaceImplementation8.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js index 6e9b09c906f8e..897fa17c4e539 100644 --- a/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/invalidModuleWithStatementsOfEveryKind.js @@ -80,11 +80,16 @@ module YYY4 { //// [invalidModuleWithStatementsOfEveryKind.js] // All of these should be an error -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Y; (function (Y) { var A = (function () { diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.js b/tests/baselines/reference/invalidMultipleVariableDeclarations.js index 340429cc3982c..466d7eb904919 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.js +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.js @@ -54,11 +54,16 @@ var m: typeof M; var m = M.A; //// [invalidMultipleVariableDeclarations.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index a6b07b7d7bd3a..a61d036d9ed41 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -21,11 +21,16 @@ function fn11(): D { return new C(); } //// [invalidReturnStatements.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // all the following should be error function fn1() { } function fn2() { } diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js index 6f1d38dcbb5bf..7c295a315f954 100644 --- a/tests/baselines/reference/isolatedModulesImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -15,11 +15,16 @@ export var z = x; //// [file1.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var module_1 = require("module"); var module_2 = require("module"); var ns = require("module"); diff --git a/tests/baselines/reference/jsxInExtendsClause.js b/tests/baselines/reference/jsxInExtendsClause.js index 8204067cb04f9..aa1c611783a92 100644 --- a/tests/baselines/reference/jsxInExtendsClause.js +++ b/tests/baselines/reference/jsxInExtendsClause.js @@ -12,11 +12,16 @@ class Foo extends createComponentClass(() => class extends React.Component<{}, { }) {} //// [jsxInExtendsClause.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function (_super) { __extends(Foo, _super); function Foo() { diff --git a/tests/baselines/reference/jsxViaImport.2.js b/tests/baselines/reference/jsxViaImport.2.js index 19432238e0bb3..635754599b169 100644 --- a/tests/baselines/reference/jsxViaImport.2.js +++ b/tests/baselines/reference/jsxViaImport.2.js @@ -25,11 +25,16 @@ class TestComponent extends React.Component { //// [consumer.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var BaseComponent_1 = require("BaseComponent"); var TestComponent = (function (_super) { diff --git a/tests/baselines/reference/jsxViaImport.js b/tests/baselines/reference/jsxViaImport.js index 604787af744e6..92d8b063a44b4 100644 --- a/tests/baselines/reference/jsxViaImport.js +++ b/tests/baselines/reference/jsxViaImport.js @@ -25,11 +25,16 @@ class TestComponent extends React.Component { //// [consumer.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var BaseComponent = require("BaseComponent"); var TestComponent = (function (_super) { diff --git a/tests/baselines/reference/keyofAndIndexedAccess.js b/tests/baselines/reference/keyofAndIndexedAccess.js index 4b93897fdc48c..bcd36b0e651a9 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.js +++ b/tests/baselines/reference/keyofAndIndexedAccess.js @@ -432,11 +432,16 @@ type SomeMethodDescriptor = { let result = dispatchMethod("someMethod", ["hello", 35]); //// [keyofAndIndexedAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Shape = (function () { function Shape() { } diff --git a/tests/baselines/reference/lambdaArgCrash.js b/tests/baselines/reference/lambdaArgCrash.js index 47db7f3ce64c1..f138aa162bd17 100644 --- a/tests/baselines/reference/lambdaArgCrash.js +++ b/tests/baselines/reference/lambdaArgCrash.js @@ -35,11 +35,16 @@ class ItemSetEvent extends Event { //// [lambdaArgCrash.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Event = (function () { function Event() { // TODO: remove diff --git a/tests/baselines/reference/lift.js b/tests/baselines/reference/lift.js index 364d52d938567..80eebe9cb00bc 100644 --- a/tests/baselines/reference/lift.js +++ b/tests/baselines/reference/lift.js @@ -18,11 +18,16 @@ class C extends B { //// [lift.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B(y) { this.y = y; diff --git a/tests/baselines/reference/localTypes1.js b/tests/baselines/reference/localTypes1.js index 100452b7a96c0..b0aaed7906a86 100644 --- a/tests/baselines/reference/localTypes1.js +++ b/tests/baselines/reference/localTypes1.js @@ -142,11 +142,16 @@ function f6() { //// [localTypes1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function f1() { var E; (function (E) { diff --git a/tests/baselines/reference/m7Bugs.js b/tests/baselines/reference/m7Bugs.js index e5a4d11f00cd8..be611c2e5cd02 100644 --- a/tests/baselines/reference/m7Bugs.js +++ b/tests/baselines/reference/m7Bugs.js @@ -27,11 +27,16 @@ var y3: C1 = {}; //// [m7Bugs.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var s = ({}); var x = {}; var C1 = (function () { diff --git a/tests/baselines/reference/mergedDeclarations5.js b/tests/baselines/reference/mergedDeclarations5.js index b24e86eca5815..d393ec00e2ca6 100644 --- a/tests/baselines/reference/mergedDeclarations5.js +++ b/tests/baselines/reference/mergedDeclarations5.js @@ -19,11 +19,16 @@ var A = (function () { return A; }()); //// [b.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function (_super) { __extends(B, _super); function B() { diff --git a/tests/baselines/reference/mergedDeclarations6.js b/tests/baselines/reference/mergedDeclarations6.js index d610e4ab46f3d..2b1f468c873de 100644 --- a/tests/baselines/reference/mergedDeclarations6.js +++ b/tests/baselines/reference/mergedDeclarations6.js @@ -37,11 +37,16 @@ define(["require", "exports"], function (require, exports) { exports.A = A; }); //// [b.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports", "./a"], function (require, exports, a_1) { "use strict"; var B = (function (_super) { diff --git a/tests/baselines/reference/mergedInheritedClassInterface.js b/tests/baselines/reference/mergedInheritedClassInterface.js index 0f598f2cf7858..29d140f3f68d1 100644 --- a/tests/baselines/reference/mergedInheritedClassInterface.js +++ b/tests/baselines/reference/mergedInheritedClassInterface.js @@ -47,11 +47,16 @@ grandchild.method2(); //// [mergedInheritedClassInterface.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var BaseClass = (function () { function BaseClass() { } diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index 6dccf1dfdd9e9..b705d58e1ebdf 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -32,11 +32,16 @@ var r = a.x; // error var r2 = a.w; // error //// [mergedInterfacesWithInheritedPrivates2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js index a3ca796575c66..c002a30a828ce 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates3.js @@ -39,11 +39,16 @@ module M { } //// [mergedInterfacesWithInheritedPrivates3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/missingPropertiesOfClassExpression.js b/tests/baselines/reference/missingPropertiesOfClassExpression.js index c7b30882b145e..7f468d14def32 100644 --- a/tests/baselines/reference/missingPropertiesOfClassExpression.js +++ b/tests/baselines/reference/missingPropertiesOfClassExpression.js @@ -7,11 +7,16 @@ class George extends class { reset() { return this.y; } } { //// [missingPropertiesOfClassExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var George = (function (_super) { __extends(George, _super); function George() { diff --git a/tests/baselines/reference/moduleAsBaseType.js b/tests/baselines/reference/moduleAsBaseType.js index fc0533a2470e3..24a04eff87284 100644 --- a/tests/baselines/reference/moduleAsBaseType.js +++ b/tests/baselines/reference/moduleAsBaseType.js @@ -5,11 +5,16 @@ interface I extends M { } class C2 implements M { } //// [moduleAsBaseType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js index 51d9eb89b1d2c..57087e49aa178 100644 --- a/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js +++ b/tests/baselines/reference/moduleImportedForTypeArgumentPosition.js @@ -16,11 +16,16 @@ define(["require", "exports"], function (require, exports) { "use strict"; }); //// [moduleImportedForTypeArgumentPosition_1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports"], function (require, exports) { "use strict"; var C1 = (function () { diff --git a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js index 4243c9849cf7f..cedfcd8b86cc4 100644 --- a/tests/baselines/reference/moduleWithStatementsOfEveryKind.js +++ b/tests/baselines/reference/moduleWithStatementsOfEveryKind.js @@ -59,11 +59,16 @@ module Y { //// [moduleWithStatementsOfEveryKind.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A; (function (A_1) { var A = (function () { diff --git a/tests/baselines/reference/multipleInheritance.js b/tests/baselines/reference/multipleInheritance.js index 9c0e865cdb774..536f694ba174c 100644 --- a/tests/baselines/reference/multipleInheritance.js +++ b/tests/baselines/reference/multipleInheritance.js @@ -39,11 +39,16 @@ class Baad extends Good { //// [multipleInheritance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B1 = (function () { function B1() { } diff --git a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js index 8b59564d46595..0e846877cb85a 100644 --- a/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js +++ b/tests/baselines/reference/mutuallyRecursiveGenericBaseTypes2.js @@ -11,11 +11,16 @@ var test = new foo(); //// [mutuallyRecursiveGenericBaseTypes2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var foo = (function () { function foo() { } diff --git a/tests/baselines/reference/newTarget.es5.js b/tests/baselines/reference/newTarget.es5.js index 0de967d547754..2ebe4bfcadcbc 100644 --- a/tests/baselines/reference/newTarget.es5.js +++ b/tests/baselines/reference/newTarget.es5.js @@ -33,11 +33,16 @@ const O = { //// [newTarget.es5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { var _newTarget = this.constructor; diff --git a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js index cc4c942237329..128591000096e 100644 --- a/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingGetAccessor.js @@ -13,11 +13,16 @@ class Child extends Parent { } //// [noImplicitAnyMissingGetAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Parent = (function () { function Parent() { } diff --git a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js index 1323955c05e7f..bb6e1e53f0fbf 100644 --- a/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js +++ b/tests/baselines/reference/noImplicitAnyMissingSetAccessor.js @@ -12,11 +12,16 @@ class Child extends Parent { } //// [noImplicitAnyMissingSetAccessor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Parent = (function () { function Parent() { } diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index b0a3365193d25..132145dbf3f48 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -6,11 +6,16 @@ class Foo { class Bar extends Foo { } // Valid //// [nonGenericClassExtendingGenericClassWithAny.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js index 92c8b380e00af..046414eba3435 100644 --- a/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/numericIndexerConstrainsPropertyDeclarations2.js @@ -47,11 +47,16 @@ var b: { [x: number]: A } = { //// [numericIndexerConstrainsPropertyDeclarations2.js] // String indexer providing a constraint of a user defined type -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/numericIndexerConstraint3.js b/tests/baselines/reference/numericIndexerConstraint3.js index 29cb75b423469..ebe02d70f7da0 100644 --- a/tests/baselines/reference/numericIndexerConstraint3.js +++ b/tests/baselines/reference/numericIndexerConstraint3.js @@ -13,11 +13,16 @@ class C { } //// [numericIndexerConstraint3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/numericIndexerConstraint4.js b/tests/baselines/reference/numericIndexerConstraint4.js index 135e169c4a9f8..fda23bce27cf5 100644 --- a/tests/baselines/reference/numericIndexerConstraint4.js +++ b/tests/baselines/reference/numericIndexerConstraint4.js @@ -13,11 +13,16 @@ var x: { //// [numericIndexerConstraint4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 5b9e797bdecde..f87198f32a7cc 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -13,11 +13,16 @@ var i2: I2; var r2: string = i2[1]; // error: numeric indexer returns the type of the string indexere //// [numericIndexerTyping2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var I = (function () { function I() { } diff --git a/tests/baselines/reference/objectCreationOfElementAccessExpression.js b/tests/baselines/reference/objectCreationOfElementAccessExpression.js index a1739ce0d8e29..72645662e01da 100644 --- a/tests/baselines/reference/objectCreationOfElementAccessExpression.js +++ b/tests/baselines/reference/objectCreationOfElementAccessExpression.js @@ -56,11 +56,16 @@ var foods2: MonsterFood[] = new PetFood[new IceCream('Mint chocolate chip') , Co //// [objectCreationOfElementAccessExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Food = (function () { function Food(name) { this.name = name; diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index 17045d65af0a9..ffe2ca6ab7e6d 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -55,11 +55,16 @@ var b: { var r4: void = b.valueOf(); //// [objectTypeHidingMembersOfExtendedObject.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js index e82cef9bdd6f2..550ef48125d6c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers1.js @@ -124,11 +124,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers1.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js index abcea11367078..249c39be6d395 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers2.js @@ -127,11 +127,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers2.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js index f5aeb177472f7..7f16c30799f9d 100644 --- a/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js +++ b/tests/baselines/reference/objectTypesIdentityWithNumericIndexers3.js @@ -124,11 +124,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithNumericIndexers3.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates.js b/tests/baselines/reference/objectTypesIdentityWithPrivates.js index 3946027063f4d..b190292227784 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates.js @@ -122,11 +122,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithPrivates.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js index 9cae6960a2ea0..8de254e15c15f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates2.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates2.js @@ -40,11 +40,16 @@ function foo6(x: any): any { } //// [objectTypesIdentityWithPrivates2.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js index 68754a583aa15..6970f06854b6c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithPrivates3.js +++ b/tests/baselines/reference/objectTypesIdentityWithPrivates3.js @@ -26,11 +26,16 @@ var c3: C3; c3; // Should fail (private x originates in the same declaration, but different types) //// [objectTypesIdentityWithPrivates3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js index b0211bbbba741..3c45a453d880c 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers.js @@ -124,11 +124,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithStringIndexers.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js index 00d7d1e81d84d..e9dce1d5366c7 100644 --- a/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js +++ b/tests/baselines/reference/objectTypesIdentityWithStringIndexers2.js @@ -127,11 +127,16 @@ function foo16(x: any) { } //// [objectTypesIdentityWithStringIndexers2.js] // object types are identical structurally -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index e460ab3fb15b3..c18a38ec343df 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -11,11 +11,16 @@ d2.foo(); //// [optionalConstructorArgInSuper.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(opt) { } diff --git a/tests/baselines/reference/optionalMethods.js b/tests/baselines/reference/optionalMethods.js index 28ed0bcd76e38..e79c6f85fd3db 100644 --- a/tests/baselines/reference/optionalMethods.js +++ b/tests/baselines/reference/optionalMethods.js @@ -58,11 +58,16 @@ class Derived extends Base { //// [optionalMethods.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function test1(x) { x.a; x.b; diff --git a/tests/baselines/reference/optionalParamArgsTest.js b/tests/baselines/reference/optionalParamArgsTest.js index 1b603898aa698..5c8503a9bef77 100644 --- a/tests/baselines/reference/optionalParamArgsTest.js +++ b/tests/baselines/reference/optionalParamArgsTest.js @@ -125,11 +125,16 @@ fnOpt2(1, [2, 3], [1], true); //// [optionalParamArgsTest.js] // Optional parameter and default argument tests -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // test basic configurations var C1 = (function () { function C1(v, p) { diff --git a/tests/baselines/reference/optionalParamInOverride.js b/tests/baselines/reference/optionalParamInOverride.js index 1312a89502ad1..03db09eac1a96 100644 --- a/tests/baselines/reference/optionalParamInOverride.js +++ b/tests/baselines/reference/optionalParamInOverride.js @@ -8,11 +8,16 @@ class Y extends Z { //// [optionalParamInOverride.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Z = (function () { function Z() { } diff --git a/tests/baselines/reference/optionalParameterProperty.js b/tests/baselines/reference/optionalParameterProperty.js index f9b9ecaf99091..fc288d0976723 100644 --- a/tests/baselines/reference/optionalParameterProperty.js +++ b/tests/baselines/reference/optionalParameterProperty.js @@ -12,11 +12,16 @@ class D extends C { //// [optionalParameterProperty.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/outModuleConcatAmd.js b/tests/baselines/reference/outModuleConcatAmd.js index 5054c2a3c335e..810cd73b5025d 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js +++ b/tests/baselines/reference/outModuleConcatAmd.js @@ -9,11 +9,16 @@ import {A} from "./ref/a"; export class B extends A { } //// [all.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define("ref/a", ["require", "exports"], function (require, exports) { "use strict"; var A = (function () { diff --git a/tests/baselines/reference/outModuleConcatAmd.js.map b/tests/baselines/reference/outModuleConcatAmd.js.map index 9187aca0646db..a95ca740a615c 100644 --- a/tests/baselines/reference/outModuleConcatAmd.js.map +++ b/tests/baselines/reference/outModuleConcatAmd.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;IACA;QAAA;QAAiB,CAAC;QAAD,QAAC;IAAD,CAAC,AAAlB,IAAkB;IAAL,cAAC;;;;ICAd;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAAf,cAAC"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;;;IACA;QAAA;QAAiB,CAAC;QAAD,QAAC;IAAD,CAAC,AAAlB,IAAkB;IAAL,cAAC;;;;ICAd;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAAf,cAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt index 34ab74816ade5..6e905832277bc 100644 --- a/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatAmd.sourcemap.txt @@ -8,11 +8,16 @@ sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts emittedFile:all.js sourceFile:tests/cases/compiler/ref/a.ts ------------------------------------------------------------------- ->>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>define("ref/a", ["require", "exports"], function (require, exports) { >>> "use strict"; >>> var A = (function () { @@ -20,13 +25,13 @@ sourceFile:tests/cases/compiler/ref/a.ts 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(8, 5) Source(2, 1) + SourceIndex(0) +1 >Emitted(13, 5) Source(2, 1) + SourceIndex(0) --- >>> function A() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(9, 9) Source(2, 1) + SourceIndex(0) +1->Emitted(14, 9) Source(2, 1) + SourceIndex(0) --- >>> } 1->^^^^^^^^ @@ -34,16 +39,16 @@ sourceFile:tests/cases/compiler/ref/a.ts 3 > ^^^^^^^^^-> 1->export class A { 2 > } -1->Emitted(10, 9) Source(2, 18) + SourceIndex(0) -2 >Emitted(10, 10) Source(2, 19) + SourceIndex(0) +1->Emitted(15, 9) Source(2, 18) + SourceIndex(0) +2 >Emitted(15, 10) Source(2, 19) + SourceIndex(0) --- >>> return A; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(11, 9) Source(2, 18) + SourceIndex(0) -2 >Emitted(11, 17) Source(2, 19) + SourceIndex(0) +1->Emitted(16, 9) Source(2, 18) + SourceIndex(0) +2 >Emitted(16, 17) Source(2, 19) + SourceIndex(0) --- >>> }()); 1 >^^^^ @@ -55,18 +60,18 @@ sourceFile:tests/cases/compiler/ref/a.ts 2 > } 3 > 4 > export class A { } -1 >Emitted(12, 5) Source(2, 18) + SourceIndex(0) -2 >Emitted(12, 6) Source(2, 19) + SourceIndex(0) -3 >Emitted(12, 6) Source(2, 1) + SourceIndex(0) -4 >Emitted(12, 10) Source(2, 19) + SourceIndex(0) +1 >Emitted(17, 5) Source(2, 18) + SourceIndex(0) +2 >Emitted(17, 6) Source(2, 19) + SourceIndex(0) +3 >Emitted(17, 6) Source(2, 1) + SourceIndex(0) +4 >Emitted(17, 10) Source(2, 19) + SourceIndex(0) --- >>> exports.A = A; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > A -1->Emitted(13, 5) Source(2, 14) + SourceIndex(0) -2 >Emitted(13, 19) Source(2, 15) + SourceIndex(0) +1->Emitted(18, 5) Source(2, 14) + SourceIndex(0) +2 >Emitted(18, 19) Source(2, 15) + SourceIndex(0) --- ------------------------------------------------------------------- emittedFile:all.js @@ -80,21 +85,21 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; > -1 >Emitted(17, 5) Source(2, 1) + SourceIndex(1) +1 >Emitted(22, 5) Source(2, 1) + SourceIndex(1) --- >>> __extends(B, _super); 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^ 1->export class B extends 2 > A -1->Emitted(18, 9) Source(2, 24) + SourceIndex(1) -2 >Emitted(18, 30) Source(2, 25) + SourceIndex(1) +1->Emitted(23, 9) Source(2, 24) + SourceIndex(1) +2 >Emitted(23, 30) Source(2, 25) + SourceIndex(1) --- >>> function B() { 1 >^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(19, 9) Source(2, 1) + SourceIndex(1) +1 >Emitted(24, 9) Source(2, 1) + SourceIndex(1) --- >>> return _super.apply(this, arguments) || this; >>> } @@ -103,16 +108,16 @@ sourceFile:tests/cases/compiler/b.ts 3 > ^^^^^^^^^-> 1->export class B extends A { 2 > } -1->Emitted(21, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(21, 10) Source(2, 29) + SourceIndex(1) +1->Emitted(26, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(26, 10) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(22, 9) Source(2, 28) + SourceIndex(1) -2 >Emitted(22, 17) Source(2, 29) + SourceIndex(1) +1->Emitted(27, 9) Source(2, 28) + SourceIndex(1) +2 >Emitted(27, 17) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^ @@ -128,20 +133,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(23, 5) Source(2, 28) + SourceIndex(1) -2 >Emitted(23, 6) Source(2, 29) + SourceIndex(1) -3 >Emitted(23, 6) Source(2, 1) + SourceIndex(1) -4 >Emitted(23, 7) Source(2, 24) + SourceIndex(1) -5 >Emitted(23, 12) Source(2, 25) + SourceIndex(1) -6 >Emitted(23, 15) Source(2, 29) + SourceIndex(1) +1 >Emitted(28, 5) Source(2, 28) + SourceIndex(1) +2 >Emitted(28, 6) Source(2, 29) + SourceIndex(1) +3 >Emitted(28, 6) Source(2, 1) + SourceIndex(1) +4 >Emitted(28, 7) Source(2, 24) + SourceIndex(1) +5 >Emitted(28, 12) Source(2, 25) + SourceIndex(1) +6 >Emitted(28, 15) Source(2, 29) + SourceIndex(1) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > B -1->Emitted(24, 5) Source(2, 14) + SourceIndex(1) -2 >Emitted(24, 19) Source(2, 15) + SourceIndex(1) +1->Emitted(29, 5) Source(2, 14) + SourceIndex(1) +2 >Emitted(29, 19) Source(2, 15) + SourceIndex(1) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.js b/tests/baselines/reference/outModuleConcatSystem.js index a615090f33a50..ff8f1f6fd0a0a 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js +++ b/tests/baselines/reference/outModuleConcatSystem.js @@ -9,11 +9,16 @@ import {A} from "./ref/a"; export class B extends A { } //// [all.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); System.register("ref/a", [], function (exports_1, context_1) { "use strict"; var __moduleName = context_1 && context_1.id; diff --git a/tests/baselines/reference/outModuleConcatSystem.js.map b/tests/baselines/reference/outModuleConcatSystem.js.map index ac8fb23d87c13..25b706844e242 100644 --- a/tests/baselines/reference/outModuleConcatSystem.js.map +++ b/tests/baselines/reference/outModuleConcatSystem.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;;;YACA;gBAAA;gBAAiB,CAAC;gBAAD,QAAC;YAAD,CAAC,AAAlB,IAAkB;;QAClB,CAAC;;;;;;;;;;;;;;YCDD;gBAAuB,qBAAC;gBAAxB;;gBAA2B,CAAC;gBAAD,QAAC;YAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;;QAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;YACA;gBAAA;gBAAiB,CAAC;gBAAD,QAAC;YAAD,CAAC,AAAlB,IAAkB;;QAClB,CAAC;;;;;;;;;;;;;;YCDD;gBAAuB,qBAAC;gBAAxB;;gBAA2B,CAAC;gBAAD,QAAC;YAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;;QAAA,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt index 732214237fa32..1a25b6358fa25 100644 --- a/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt +++ b/tests/baselines/reference/outModuleConcatSystem.sourcemap.txt @@ -8,11 +8,16 @@ sources: tests/cases/compiler/ref/a.ts,tests/cases/compiler/b.ts emittedFile:all.js sourceFile:tests/cases/compiler/ref/a.ts ------------------------------------------------------------------- ->>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>System.register("ref/a", [], function (exports_1, context_1) { >>> "use strict"; >>> var __moduleName = context_1 && context_1.id; @@ -25,13 +30,13 @@ sourceFile:tests/cases/compiler/ref/a.ts 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(13, 13) Source(2, 1) + SourceIndex(0) +1 >Emitted(18, 13) Source(2, 1) + SourceIndex(0) --- >>> function A() { 1->^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(14, 17) Source(2, 1) + SourceIndex(0) +1->Emitted(19, 17) Source(2, 1) + SourceIndex(0) --- >>> } 1->^^^^^^^^^^^^^^^^ @@ -39,16 +44,16 @@ sourceFile:tests/cases/compiler/ref/a.ts 3 > ^^^^^^^^^-> 1->export class A { 2 > } -1->Emitted(15, 17) Source(2, 18) + SourceIndex(0) -2 >Emitted(15, 18) Source(2, 19) + SourceIndex(0) +1->Emitted(20, 17) Source(2, 18) + SourceIndex(0) +2 >Emitted(20, 18) Source(2, 19) + SourceIndex(0) --- >>> return A; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(16, 17) Source(2, 18) + SourceIndex(0) -2 >Emitted(16, 25) Source(2, 19) + SourceIndex(0) +1->Emitted(21, 17) Source(2, 18) + SourceIndex(0) +2 >Emitted(21, 25) Source(2, 19) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^ @@ -60,10 +65,10 @@ sourceFile:tests/cases/compiler/ref/a.ts 2 > } 3 > 4 > export class A { } -1 >Emitted(17, 13) Source(2, 18) + SourceIndex(0) -2 >Emitted(17, 14) Source(2, 19) + SourceIndex(0) -3 >Emitted(17, 14) Source(2, 1) + SourceIndex(0) -4 >Emitted(17, 18) Source(2, 19) + SourceIndex(0) +1 >Emitted(22, 13) Source(2, 18) + SourceIndex(0) +2 >Emitted(22, 14) Source(2, 19) + SourceIndex(0) +3 >Emitted(22, 14) Source(2, 1) + SourceIndex(0) +4 >Emitted(22, 18) Source(2, 19) + SourceIndex(0) --- >>> exports_1("A", A); >>> } @@ -72,8 +77,8 @@ sourceFile:tests/cases/compiler/ref/a.ts 1-> > 2 > -1->Emitted(19, 9) Source(3, 1) + SourceIndex(0) -2 >Emitted(19, 10) Source(3, 2) + SourceIndex(0) +1->Emitted(24, 9) Source(3, 1) + SourceIndex(0) +2 >Emitted(24, 10) Source(3, 2) + SourceIndex(0) --- ------------------------------------------------------------------- emittedFile:all.js @@ -97,21 +102,21 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; > -1 >Emitted(33, 13) Source(2, 1) + SourceIndex(1) +1 >Emitted(38, 13) Source(2, 1) + SourceIndex(1) --- >>> __extends(B, _super); 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^ 1->export class B extends 2 > A -1->Emitted(34, 17) Source(2, 24) + SourceIndex(1) -2 >Emitted(34, 38) Source(2, 25) + SourceIndex(1) +1->Emitted(39, 17) Source(2, 24) + SourceIndex(1) +2 >Emitted(39, 38) Source(2, 25) + SourceIndex(1) --- >>> function B() { 1 >^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(35, 17) Source(2, 1) + SourceIndex(1) +1 >Emitted(40, 17) Source(2, 1) + SourceIndex(1) --- >>> return _super.apply(this, arguments) || this; >>> } @@ -120,16 +125,16 @@ sourceFile:tests/cases/compiler/b.ts 3 > ^^^^^^^^^-> 1->export class B extends A { 2 > } -1->Emitted(37, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(37, 18) Source(2, 29) + SourceIndex(1) +1->Emitted(42, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(42, 18) Source(2, 29) + SourceIndex(1) --- >>> return B; 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(38, 17) Source(2, 28) + SourceIndex(1) -2 >Emitted(38, 25) Source(2, 29) + SourceIndex(1) +1->Emitted(43, 17) Source(2, 28) + SourceIndex(1) +2 >Emitted(43, 25) Source(2, 29) + SourceIndex(1) --- >>> }(a_1.A)); 1 >^^^^^^^^^^^^ @@ -145,12 +150,12 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(39, 13) Source(2, 28) + SourceIndex(1) -2 >Emitted(39, 14) Source(2, 29) + SourceIndex(1) -3 >Emitted(39, 14) Source(2, 1) + SourceIndex(1) -4 >Emitted(39, 15) Source(2, 24) + SourceIndex(1) -5 >Emitted(39, 20) Source(2, 25) + SourceIndex(1) -6 >Emitted(39, 23) Source(2, 29) + SourceIndex(1) +1 >Emitted(44, 13) Source(2, 28) + SourceIndex(1) +2 >Emitted(44, 14) Source(2, 29) + SourceIndex(1) +3 >Emitted(44, 14) Source(2, 1) + SourceIndex(1) +4 >Emitted(44, 15) Source(2, 24) + SourceIndex(1) +5 >Emitted(44, 20) Source(2, 25) + SourceIndex(1) +6 >Emitted(44, 23) Source(2, 29) + SourceIndex(1) --- >>> exports_2("B", B); >>> } @@ -158,8 +163,8 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^ 1-> 2 > -1->Emitted(41, 9) Source(2, 29) + SourceIndex(1) -2 >Emitted(41, 10) Source(2, 30) + SourceIndex(1) +1->Emitted(46, 9) Source(2, 29) + SourceIndex(1) +2 >Emitted(46, 10) Source(2, 30) + SourceIndex(1) --- >>> }; >>>}); diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js b/tests/baselines/reference/outModuleTripleSlashRefs.js index b9ff7c15b61a2..b144c6e74c81a 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js @@ -31,11 +31,16 @@ export class B extends A { } //// [all.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.js.map b/tests/baselines/reference/outModuleTripleSlashRefs.js.map index 5ccc59aeabfb3..e91088c249c8a 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.js.map +++ b/tests/baselines/reference/outModuleTripleSlashRefs.js.map @@ -1,2 +1,2 @@ //// [all.js.map] -{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/b.ts","tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;AAAA,iCAAiC;AACjC;IAAA;IAEA,CAAC;IAAD,UAAC;AAAD,CAAC,AAFD,IAEC;;;ICFD,+BAA+B;IAC/B;QAAA;QAEA,CAAC;QAAD,QAAC;IAAD,CAAC,AAFD,IAEC;IAFY,cAAC;;;;ICDd;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAAf,cAAC"} \ No newline at end of file +{"version":3,"file":"all.js","sourceRoot":"","sources":["tests/cases/compiler/ref/b.ts","tests/cases/compiler/ref/a.ts","tests/cases/compiler/b.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,iCAAiC;AACjC;IAAA;IAEA,CAAC;IAAD,UAAC;AAAD,CAAC,AAFD,IAEC;;;ICFD,+BAA+B;IAC/B;QAAA;QAEA,CAAC;QAAD,QAAC;IAAD,CAAC,AAFD,IAEC;IAFY,cAAC;;;;ICDd;QAAuB,qBAAC;QAAxB;;QAA2B,CAAC;QAAD,QAAC;IAAD,CAAC,AAA5B,CAAuB,KAAC,GAAI;IAAf,cAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt index ce41bae6de338..0f20e86cd005e 100644 --- a/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt +++ b/tests/baselines/reference/outModuleTripleSlashRefs.sourcemap.txt @@ -8,31 +8,36 @@ sources: tests/cases/compiler/ref/b.ts,tests/cases/compiler/ref/a.ts,tests/cases emittedFile:all.js sourceFile:tests/cases/compiler/ref/b.ts ------------------------------------------------------------------- ->>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>/// 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1 > 2 >/// -1 >Emitted(6, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(6, 34) Source(1, 34) + SourceIndex(0) +1 >Emitted(11, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(11, 34) Source(1, 34) + SourceIndex(0) --- >>>var Foo = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(7, 1) Source(2, 1) + SourceIndex(0) +1 >Emitted(12, 1) Source(2, 1) + SourceIndex(0) --- >>> function Foo() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(8, 5) Source(2, 1) + SourceIndex(0) +1->Emitted(13, 5) Source(2, 1) + SourceIndex(0) --- >>> } 1->^^^^ @@ -42,16 +47,16 @@ sourceFile:tests/cases/compiler/ref/b.ts > member: Bar; > 2 > } -1->Emitted(9, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(9, 6) Source(4, 2) + SourceIndex(0) +1->Emitted(14, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(14, 6) Source(4, 2) + SourceIndex(0) --- >>> return Foo; 1->^^^^ 2 > ^^^^^^^^^^ 1-> 2 > } -1->Emitted(10, 5) Source(4, 1) + SourceIndex(0) -2 >Emitted(10, 15) Source(4, 2) + SourceIndex(0) +1->Emitted(15, 5) Source(4, 1) + SourceIndex(0) +2 >Emitted(15, 15) Source(4, 2) + SourceIndex(0) --- >>>}()); 1 > @@ -65,10 +70,10 @@ sourceFile:tests/cases/compiler/ref/b.ts 4 > class Foo { > member: Bar; > } -1 >Emitted(11, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(11, 2) Source(4, 2) + SourceIndex(0) -3 >Emitted(11, 2) Source(2, 1) + SourceIndex(0) -4 >Emitted(11, 6) Source(4, 2) + SourceIndex(0) +1 >Emitted(16, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(16, 2) Source(4, 2) + SourceIndex(0) +3 >Emitted(16, 2) Source(2, 1) + SourceIndex(0) +4 >Emitted(16, 6) Source(4, 2) + SourceIndex(0) --- ------------------------------------------------------------------- emittedFile:all.js @@ -82,21 +87,21 @@ sourceFile:tests/cases/compiler/ref/a.ts 1-> > 2 > /// -1->Emitted(14, 5) Source(2, 1) + SourceIndex(1) -2 >Emitted(14, 36) Source(2, 32) + SourceIndex(1) +1->Emitted(19, 5) Source(2, 1) + SourceIndex(1) +2 >Emitted(19, 36) Source(2, 32) + SourceIndex(1) --- >>> var A = (function () { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^-> 1 > > -1 >Emitted(15, 5) Source(3, 1) + SourceIndex(1) +1 >Emitted(20, 5) Source(3, 1) + SourceIndex(1) --- >>> function A() { 1->^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(16, 9) Source(3, 1) + SourceIndex(1) +1->Emitted(21, 9) Source(3, 1) + SourceIndex(1) --- >>> } 1->^^^^^^^^ @@ -106,16 +111,16 @@ sourceFile:tests/cases/compiler/ref/a.ts > member: typeof GlobalFoo; > 2 > } -1->Emitted(17, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(17, 10) Source(5, 2) + SourceIndex(1) +1->Emitted(22, 9) Source(5, 1) + SourceIndex(1) +2 >Emitted(22, 10) Source(5, 2) + SourceIndex(1) --- >>> return A; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(18, 9) Source(5, 1) + SourceIndex(1) -2 >Emitted(18, 17) Source(5, 2) + SourceIndex(1) +1->Emitted(23, 9) Source(5, 1) + SourceIndex(1) +2 >Emitted(23, 17) Source(5, 2) + SourceIndex(1) --- >>> }()); 1 >^^^^ @@ -129,18 +134,18 @@ sourceFile:tests/cases/compiler/ref/a.ts 4 > export class A { > member: typeof GlobalFoo; > } -1 >Emitted(19, 5) Source(5, 1) + SourceIndex(1) -2 >Emitted(19, 6) Source(5, 2) + SourceIndex(1) -3 >Emitted(19, 6) Source(3, 1) + SourceIndex(1) -4 >Emitted(19, 10) Source(5, 2) + SourceIndex(1) +1 >Emitted(24, 5) Source(5, 1) + SourceIndex(1) +2 >Emitted(24, 6) Source(5, 2) + SourceIndex(1) +3 >Emitted(24, 6) Source(3, 1) + SourceIndex(1) +4 >Emitted(24, 10) Source(5, 2) + SourceIndex(1) --- >>> exports.A = A; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > A -1->Emitted(20, 5) Source(3, 14) + SourceIndex(1) -2 >Emitted(20, 19) Source(3, 15) + SourceIndex(1) +1->Emitted(25, 5) Source(3, 14) + SourceIndex(1) +2 >Emitted(25, 19) Source(3, 15) + SourceIndex(1) --- ------------------------------------------------------------------- emittedFile:all.js @@ -154,21 +159,21 @@ sourceFile:tests/cases/compiler/b.ts 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >import {A} from "./ref/a"; > -1 >Emitted(24, 5) Source(2, 1) + SourceIndex(2) +1 >Emitted(29, 5) Source(2, 1) + SourceIndex(2) --- >>> __extends(B, _super); 1->^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^ 1->export class B extends 2 > A -1->Emitted(25, 9) Source(2, 24) + SourceIndex(2) -2 >Emitted(25, 30) Source(2, 25) + SourceIndex(2) +1->Emitted(30, 9) Source(2, 24) + SourceIndex(2) +2 >Emitted(30, 30) Source(2, 25) + SourceIndex(2) --- >>> function B() { 1 >^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(26, 9) Source(2, 1) + SourceIndex(2) +1 >Emitted(31, 9) Source(2, 1) + SourceIndex(2) --- >>> return _super.apply(this, arguments) || this; >>> } @@ -177,16 +182,16 @@ sourceFile:tests/cases/compiler/b.ts 3 > ^^^^^^^^^-> 1->export class B extends A { 2 > } -1->Emitted(28, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(28, 10) Source(2, 29) + SourceIndex(2) +1->Emitted(33, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(33, 10) Source(2, 29) + SourceIndex(2) --- >>> return B; 1->^^^^^^^^ 2 > ^^^^^^^^ 1-> 2 > } -1->Emitted(29, 9) Source(2, 28) + SourceIndex(2) -2 >Emitted(29, 17) Source(2, 29) + SourceIndex(2) +1->Emitted(34, 9) Source(2, 28) + SourceIndex(2) +2 >Emitted(34, 17) Source(2, 29) + SourceIndex(2) --- >>> }(a_1.A)); 1 >^^^^ @@ -202,20 +207,20 @@ sourceFile:tests/cases/compiler/b.ts 4 > export class B extends 5 > A 6 > { } -1 >Emitted(30, 5) Source(2, 28) + SourceIndex(2) -2 >Emitted(30, 6) Source(2, 29) + SourceIndex(2) -3 >Emitted(30, 6) Source(2, 1) + SourceIndex(2) -4 >Emitted(30, 7) Source(2, 24) + SourceIndex(2) -5 >Emitted(30, 12) Source(2, 25) + SourceIndex(2) -6 >Emitted(30, 15) Source(2, 29) + SourceIndex(2) +1 >Emitted(35, 5) Source(2, 28) + SourceIndex(2) +2 >Emitted(35, 6) Source(2, 29) + SourceIndex(2) +3 >Emitted(35, 6) Source(2, 1) + SourceIndex(2) +4 >Emitted(35, 7) Source(2, 24) + SourceIndex(2) +5 >Emitted(35, 12) Source(2, 25) + SourceIndex(2) +6 >Emitted(35, 15) Source(2, 29) + SourceIndex(2) --- >>> exports.B = B; 1->^^^^ 2 > ^^^^^^^^^^^^^^ 1-> 2 > B -1->Emitted(31, 5) Source(2, 14) + SourceIndex(2) -2 >Emitted(31, 19) Source(2, 15) + SourceIndex(2) +1->Emitted(36, 5) Source(2, 14) + SourceIndex(2) +2 >Emitted(36, 19) Source(2, 15) + SourceIndex(2) --- >>>}); >>>//# sourceMappingURL=all.js.map \ No newline at end of file diff --git a/tests/baselines/reference/overload1.js b/tests/baselines/reference/overload1.js index 41aafdfb29c2d..eddb4181ad6c5 100644 --- a/tests/baselines/reference/overload1.js +++ b/tests/baselines/reference/overload1.js @@ -40,11 +40,16 @@ var v=x.g; //// [overload1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var O; (function (O) { var A = (function () { diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks1.js b/tests/baselines/reference/overloadOnConstConstraintChecks1.js index f9d1c81b06b99..058a294833ce4 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks1.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks1.js @@ -23,11 +23,16 @@ class D implements MyDoc { } //// [overloadOnConstConstraintChecks1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks2.js b/tests/baselines/reference/overloadOnConstConstraintChecks2.js index a680a62ddfef6..9cbbedfabb36a 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks2.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks2.js @@ -12,11 +12,16 @@ function foo(name: any): A { } //// [overloadOnConstConstraintChecks2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks3.js b/tests/baselines/reference/overloadOnConstConstraintChecks3.js index 025e449fd6f69..5f710f178373b 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks3.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks3.js @@ -13,11 +13,16 @@ function foo(name: any): A { //// [overloadOnConstConstraintChecks3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { this.x = 1; diff --git a/tests/baselines/reference/overloadOnConstConstraintChecks4.js b/tests/baselines/reference/overloadOnConstConstraintChecks4.js index 0f436a5f0b2c9..afa8d83cb136e 100644 --- a/tests/baselines/reference/overloadOnConstConstraintChecks4.js +++ b/tests/baselines/reference/overloadOnConstConstraintChecks4.js @@ -14,11 +14,16 @@ function foo(name: any): Z { //// [overloadOnConstConstraintChecks4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Z = (function () { function Z() { } diff --git a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js index e3f58c0f7d0d2..534a4f9dde807 100644 --- a/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js +++ b/tests/baselines/reference/overloadOnConstantsInvalidOverload1.js @@ -12,11 +12,16 @@ function foo(name: "DIV"): Derived2 { foo("HI"); //// [overloadOnConstantsInvalidOverload1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/overloadResolution.js b/tests/baselines/reference/overloadResolution.js index e5cc35c39c4cb..b154ceff837fa 100644 --- a/tests/baselines/reference/overloadResolution.js +++ b/tests/baselines/reference/overloadResolution.js @@ -95,11 +95,16 @@ var s = fn5((n) => n.substr(0)); //// [overloadResolution.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SomeBase = (function () { function SomeBase() { } diff --git a/tests/baselines/reference/overloadResolutionClassConstructors.js b/tests/baselines/reference/overloadResolutionClassConstructors.js index 7c8b2e2ccb6ed..45d07483f4fdf 100644 --- a/tests/baselines/reference/overloadResolutionClassConstructors.js +++ b/tests/baselines/reference/overloadResolutionClassConstructors.js @@ -102,11 +102,16 @@ new fn5((n) => n.blah); // Error //// [overloadResolutionClassConstructors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SomeBase = (function () { function SomeBase() { } diff --git a/tests/baselines/reference/overloadResolutionConstructors.js b/tests/baselines/reference/overloadResolutionConstructors.js index 44bbfbcec2b51..4a64e8be9179d 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.js +++ b/tests/baselines/reference/overloadResolutionConstructors.js @@ -103,11 +103,16 @@ var s = new fn5((n) => n.substr(0)); //// [overloadResolutionConstructors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SomeBase = (function () { function SomeBase() { } diff --git a/tests/baselines/reference/overloadingOnConstants1.js b/tests/baselines/reference/overloadingOnConstants1.js index 96f4f7baf2442..774436ba5eec9 100644 --- a/tests/baselines/reference/overloadingOnConstants1.js +++ b/tests/baselines/reference/overloadingOnConstants1.js @@ -26,11 +26,16 @@ var htmlDivElement2: Derived1 = d2.createElement("div"); var htmlSpanElement2: Derived1 = d2.createElement("span"); //// [overloadingOnConstants1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 0c34d0f4b7694..6cc20caa80ec0 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -28,11 +28,16 @@ var e: E = bar("bye", []); // E var f: C = bar("um", []); // C //// [overloadingOnConstants2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.x = 1; diff --git a/tests/baselines/reference/overridingPrivateStaticMembers.js b/tests/baselines/reference/overridingPrivateStaticMembers.js index ca5616450baea..f7fb709cda251 100644 --- a/tests/baselines/reference/overridingPrivateStaticMembers.js +++ b/tests/baselines/reference/overridingPrivateStaticMembers.js @@ -8,11 +8,16 @@ class Derived2 extends Base2 { } //// [overridingPrivateStaticMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base2 = (function () { function Base2() { } diff --git a/tests/baselines/reference/parseErrorInHeritageClause1.js b/tests/baselines/reference/parseErrorInHeritageClause1.js index a9ca0a6db7342..647ddb733a705 100644 --- a/tests/baselines/reference/parseErrorInHeritageClause1.js +++ b/tests/baselines/reference/parseErrorInHeritageClause1.js @@ -3,11 +3,16 @@ class C extends A # { } //// [parseErrorInHeritageClause1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parser509630.js b/tests/baselines/reference/parser509630.js index d3648dc5b6457..6676b2499dd70 100644 --- a/tests/baselines/reference/parser509630.js +++ b/tests/baselines/reference/parser509630.js @@ -7,11 +7,16 @@ class Any extends Type { //// [parser509630.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Type = (function () { function Type() { this.examples = []; // typing here diff --git a/tests/baselines/reference/parserAstSpans1.js b/tests/baselines/reference/parserAstSpans1.js index 6b86353b959d4..ae274f3dcbba0 100644 --- a/tests/baselines/reference/parserAstSpans1.js +++ b/tests/baselines/reference/parserAstSpans1.js @@ -220,11 +220,16 @@ class c6 extends c5 { } //// [parserAstSpans1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var c1 = (function () { function c1() { } diff --git a/tests/baselines/reference/parserClassDeclaration1.js b/tests/baselines/reference/parserClassDeclaration1.js index a61b492b7a935..11c087cf5689f 100644 --- a/tests/baselines/reference/parserClassDeclaration1.js +++ b/tests/baselines/reference/parserClassDeclaration1.js @@ -3,11 +3,16 @@ class C extends A extends B { } //// [parserClassDeclaration1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserClassDeclaration3.js b/tests/baselines/reference/parserClassDeclaration3.js index f58f0ab00cb96..886fce518929a 100644 --- a/tests/baselines/reference/parserClassDeclaration3.js +++ b/tests/baselines/reference/parserClassDeclaration3.js @@ -3,11 +3,16 @@ class C implements A extends B { } //// [parserClassDeclaration3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserClassDeclaration4.js b/tests/baselines/reference/parserClassDeclaration4.js index 912aa8c658198..d9f1f1acbedf9 100644 --- a/tests/baselines/reference/parserClassDeclaration4.js +++ b/tests/baselines/reference/parserClassDeclaration4.js @@ -3,11 +3,16 @@ class C extends A implements B extends C { } //// [parserClassDeclaration4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserClassDeclaration5.js b/tests/baselines/reference/parserClassDeclaration5.js index 054aaf0eb7a49..38fa87e2ce143 100644 --- a/tests/baselines/reference/parserClassDeclaration5.js +++ b/tests/baselines/reference/parserClassDeclaration5.js @@ -3,11 +3,16 @@ class C extends A implements B implements C { } //// [parserClassDeclaration5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserClassDeclaration6.js b/tests/baselines/reference/parserClassDeclaration6.js index 1423edfe037ad..a4720967984f0 100644 --- a/tests/baselines/reference/parserClassDeclaration6.js +++ b/tests/baselines/reference/parserClassDeclaration6.js @@ -3,11 +3,16 @@ class C extends A, B { } //// [parserClassDeclaration6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js index aa0679bb8f5af..231b4fb3d0605 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause2.js @@ -3,11 +3,16 @@ class C extends A, { } //// [parserErrorRecovery_ExtendsOrImplementsClause2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js index 1308c7c194bff..584088cd51126 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause4.js @@ -3,11 +3,16 @@ class C extends A implements { } //// [parserErrorRecovery_ExtendsOrImplementsClause4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js index b1471628fbd9b..97dd2af292587 100644 --- a/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js +++ b/tests/baselines/reference/parserErrorRecovery_ExtendsOrImplementsClause5.js @@ -3,11 +3,16 @@ class C extends A, implements B, { } //// [parserErrorRecovery_ExtendsOrImplementsClause5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserGenericsInTypeContexts1.js b/tests/baselines/reference/parserGenericsInTypeContexts1.js index 641d296dc4359..a072e9c356519 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts1.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts1.js @@ -18,11 +18,16 @@ function f2(): F { //// [parserGenericsInTypeContexts1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserGenericsInTypeContexts2.js b/tests/baselines/reference/parserGenericsInTypeContexts2.js index b0f14a090ae5f..7e8694e9416d6 100644 --- a/tests/baselines/reference/parserGenericsInTypeContexts2.js +++ b/tests/baselines/reference/parserGenericsInTypeContexts2.js @@ -18,11 +18,16 @@ function f2(): F, Y>> { //// [parserGenericsInTypeContexts2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/parserRealSource10.js b/tests/baselines/reference/parserRealSource10.js index 11cfbdfa1f21e..0d42dc5f47b72 100644 --- a/tests/baselines/reference/parserRealSource10.js +++ b/tests/baselines/reference/parserRealSource10.js @@ -458,11 +458,16 @@ module TypeScript { //// [parserRealSource10.js] // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var TypeScript; (function (TypeScript) { diff --git a/tests/baselines/reference/parserRealSource11.js b/tests/baselines/reference/parserRealSource11.js index eb05d13f4ed43..0d942cb1c68d4 100644 --- a/tests/baselines/reference/parserRealSource11.js +++ b/tests/baselines/reference/parserRealSource11.js @@ -2367,11 +2367,16 @@ module TypeScript { //// [parserRealSource11.js] // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// var TypeScript; (function (TypeScript) { diff --git a/tests/baselines/reference/parserharness.js b/tests/baselines/reference/parserharness.js index 14ce433817695..5090c33bdc8ca 100644 --- a/tests/baselines/reference/parserharness.js +++ b/tests/baselines/reference/parserharness.js @@ -2096,11 +2096,16 @@ module Harness { // See the License for the specific language governing permissions and // limitations under the License. // -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); /// /// /// diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js index 9702595fffbed..e09713cfdfa41 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceError.js @@ -16,11 +16,16 @@ testError((t1, t2, t3: D) => {}) //// [partiallyAnnotatedFunctionInferenceError.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js index d20b35625e961..2647bd4d8eefb 100644 --- a/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js +++ b/tests/baselines/reference/partiallyAnnotatedFunctionInferenceWithTypeParameter.js @@ -35,11 +35,16 @@ testRest((t2, ...t3: D[]) => {}) //// [partiallyAnnotatedFunctionInferenceWithTypeParameter.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/primitiveMembers.js b/tests/baselines/reference/primitiveMembers.js index 7b94b555eb16a..d378e5abee042 100644 --- a/tests/baselines/reference/primitiveMembers.js +++ b/tests/baselines/reference/primitiveMembers.js @@ -32,11 +32,16 @@ class foo extends baz { public bar(){ return undefined}; } //// [primitiveMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x = 5; var r = /yo/; r.source; diff --git a/tests/baselines/reference/privacyClass.js b/tests/baselines/reference/privacyClass.js index 7e56edf2cf1b4..154e4ad453dee 100644 --- a/tests/baselines/reference/privacyClass.js +++ b/tests/baselines/reference/privacyClass.js @@ -129,11 +129,16 @@ export class glo_C12_public extends glo_c_private implements glo_i_private, glo //// [privacyClass.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var m1; (function (m1) { var m1_c_public = (function () { diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js index e0828809416bd..04f18d61340c0 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.js @@ -99,11 +99,16 @@ class publicClassExtendingPublicClassInGlobal extends publicClassInGlobal { //// [privacyClassExtendsClauseDeclFile_externalModule.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var publicModule; (function (publicModule) { var publicClassInPublicModule = (function () { @@ -285,11 +290,16 @@ var publicClassExtendingFromPrivateModuleClass = (function (_super) { }(privateModule.publicClassInPrivateModule)); exports.publicClassExtendingFromPrivateModuleClass = publicClassExtendingFromPrivateModuleClass; //// [privacyClassExtendsClauseDeclFile_GlobalFile.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var publicModuleInGlobal; (function (publicModuleInGlobal) { var publicClassInPublicModule = (function () { diff --git a/tests/baselines/reference/privacyGloClass.js b/tests/baselines/reference/privacyGloClass.js index fa769a606ae89..017bd375b540f 100644 --- a/tests/baselines/reference/privacyGloClass.js +++ b/tests/baselines/reference/privacyGloClass.js @@ -61,11 +61,16 @@ class glo_C11_public extends glo_c_public implements glo_i_public { //// [privacyGloClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var m1; (function (m1) { var m1_c_public = (function () { diff --git a/tests/baselines/reference/privateAccessInSubclass1.js b/tests/baselines/reference/privateAccessInSubclass1.js index 21ff4793fb35e..cf1a6cb1d44f3 100644 --- a/tests/baselines/reference/privateAccessInSubclass1.js +++ b/tests/baselines/reference/privateAccessInSubclass1.js @@ -10,11 +10,16 @@ class D extends Base { } //// [privateAccessInSubclass1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/privateInstanceMemberAccessibility.js b/tests/baselines/reference/privateInstanceMemberAccessibility.js index 6fa05178f9128..72f1ea01f0deb 100644 --- a/tests/baselines/reference/privateInstanceMemberAccessibility.js +++ b/tests/baselines/reference/privateInstanceMemberAccessibility.js @@ -14,11 +14,16 @@ class Derived extends Base { } //// [privateInstanceMemberAccessibility.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js index b732661edfc3e..96808c3daeb12 100644 --- a/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js +++ b/tests/baselines/reference/privateProtectedMembersAreNotAccessibleDestructuring.js @@ -22,11 +22,16 @@ let { priv: a, prot: b, privateMethod: f } = k; // error //// [privateProtectedMembersAreNotAccessibleDestructuring.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var K = (function () { function K() { } diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index c1897e8503a92..19da5064fbb92 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -9,11 +9,16 @@ class Derived extends Base { } //// [privateStaticMemberAccessibility.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index a93823654d4ad..eceda3830920c 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -16,11 +16,16 @@ module D { //// [privateStaticNotAccessibleInClodule2.js] // Any attempt to access a private property member outside the class body that contains its declaration results in a compile-time error. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js index 99a4842f63641..bf8401f6b4db4 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/amd/testGlo.js @@ -1,8 +1,13 @@ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var m2; (function (m2) { m2.c1 = new m2.mExported.me.class1; diff --git a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js index 99a4842f63641..bf8401f6b4db4 100644 --- a/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js +++ b/tests/baselines/reference/project/privacyCheckOnImportedModuleDeclarationsInsideModule/node/testGlo.js @@ -1,8 +1,13 @@ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var m2; (function (m2) { m2.c1 = new m2.mExported.me.class1; diff --git a/tests/baselines/reference/project/prologueEmit/amd/out.js b/tests/baselines/reference/project/prologueEmit/amd/out.js index 7ee160b82efac..5fdfd47518642 100644 --- a/tests/baselines/reference/project/prologueEmit/amd/out.js +++ b/tests/baselines/reference/project/prologueEmit/amd/out.js @@ -1,8 +1,13 @@ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; // Add a lambda to ensure global 'this' capture is triggered (function () { return _this.window; }); diff --git a/tests/baselines/reference/project/prologueEmit/node/out.js b/tests/baselines/reference/project/prologueEmit/node/out.js index 7ee160b82efac..5fdfd47518642 100644 --- a/tests/baselines/reference/project/prologueEmit/node/out.js +++ b/tests/baselines/reference/project/prologueEmit/node/out.js @@ -1,8 +1,13 @@ -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; // Add a lambda to ensure global 'this' capture is triggered (function () { return _this.window; }); diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js index b793b07534c46..2fe4870822f09 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/amd/m'ain.js @@ -1,9 +1,14 @@ /// -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { diff --git a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js index b793b07534c46..2fe4870822f09 100644 --- a/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js +++ b/tests/baselines/reference/project/quotesInFileAndDirectoryNames/node/m'ain.js @@ -1,9 +1,14 @@ /// -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ClassC = (function (_super) { __extends(ClassC, _super); function ClassC() { diff --git a/tests/baselines/reference/propertiesAndIndexers.js b/tests/baselines/reference/propertiesAndIndexers.js index dff86f3954e21..899390cc913cb 100644 --- a/tests/baselines/reference/propertiesAndIndexers.js +++ b/tests/baselines/reference/propertiesAndIndexers.js @@ -52,11 +52,16 @@ var c: { }; //// [propertiesAndIndexers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var P = (function () { function P() { } diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index 0a4c9082a2162..f9b92420a70db 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -151,11 +151,16 @@ var x3: A; //// [propertyAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index d36d7e27efe94..b3464d30f9c84 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -83,11 +83,16 @@ var r4 = b.foo(aB, aB); // no inferences for T so constraint isn't satisfied, er //// [propertyAccessOnTypeParameterWithConstraints2.js] // generic types should behave as if they have properties of their constraint type -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index 4aedfe12b0404..a43b44c4b2b21 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -58,11 +58,16 @@ var r4 = b.foo(new B()); // valid call to an invalid function //// [propertyAccessOnTypeParameterWithConstraints3.js] // generic types should behave as if they have properties of their constraint type -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index 3cb1443814122..604131ef7b715 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -45,11 +45,16 @@ var b = { var r4 = b.foo(new B()); // error after constraints above made illegal, doesn't matter //// [propertyAccessOnTypeParameterWithConstraints5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js index 429dfdf6b14aa..0756ef8ca9b4f 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass.js @@ -39,11 +39,16 @@ class E extends C { } //// [protectedClassPropertyAccessibleWithinNestedSubclass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js index 0571b85ea9e2a..6d0c068039fb7 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinNestedSubclass1.js @@ -115,11 +115,16 @@ d3.x; // Error, neither within their declaring class nor class d4.x; // Error, neither within their declaring class nor classes derived from their declaring class //// [protectedClassPropertyAccessibleWithinNestedSubclass1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js index a10b39b402e4d..c2f072b213b0c 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass.js @@ -21,11 +21,16 @@ class C extends B { //// [protectedClassPropertyAccessibleWithinSubclass.js] // no errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js index a404b8049bc47..b7421c6161cba 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass2.js @@ -95,11 +95,16 @@ d3.x; // Error, neither within their declaring class nor class d4.x; // Error, neither within their declaring class nor classes derived from their declaring class //// [protectedClassPropertyAccessibleWithinSubclass2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js index 7d449bdcbd4c9..72cf5039e6c6c 100644 --- a/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js +++ b/tests/baselines/reference/protectedClassPropertyAccessibleWithinSubclass3.js @@ -14,11 +14,16 @@ class Derived extends Base { } //// [protectedClassPropertyAccessibleWithinSubclass3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/protectedInstanceMemberAccessibility.js b/tests/baselines/reference/protectedInstanceMemberAccessibility.js index 3259d401270d8..dc74f3ed1905f 100644 --- a/tests/baselines/reference/protectedInstanceMemberAccessibility.js +++ b/tests/baselines/reference/protectedInstanceMemberAccessibility.js @@ -45,11 +45,16 @@ class C extends A { //// [protectedInstanceMemberAccessibility.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/protectedMembers.js b/tests/baselines/reference/protectedMembers.js index 46b4691dff77f..fddbdf80bcc7e 100644 --- a/tests/baselines/reference/protectedMembers.js +++ b/tests/baselines/reference/protectedMembers.js @@ -116,11 +116,16 @@ class B3 extends A3 { //// [protectedMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Class with protected members var C1 = (function () { function C1() { diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js index ad1b1682aa73e..9564b6e35b980 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass.js @@ -44,11 +44,16 @@ Derived2.x; // Error, neither within their declaring class nor classes deriv Derived3.x; // Error, neither within their declaring class nor classes derived from their declaring class //// [protectedStaticClassPropertyAccessibleWithinSubclass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js index a2346b8be40a3..ca6af2bc4edfc 100644 --- a/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js +++ b/tests/baselines/reference/protectedStaticClassPropertyAccessibleWithinSubclass2.js @@ -22,11 +22,16 @@ class Derived2 extends Derived1 { } //// [protectedStaticClassPropertyAccessibleWithinSubclass2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js index a881eb55a1811..ff51753f68306 100644 --- a/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js +++ b/tests/baselines/reference/qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js @@ -7,11 +7,16 @@ class Beta extends Alpha.x { } //// [qualifiedName_entity-name-resolution-does-not-affect-class-heritage.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Alpha; (function (Alpha) { Alpha.x = 100; diff --git a/tests/baselines/reference/readonlyConstructorAssignment.js b/tests/baselines/reference/readonlyConstructorAssignment.js index 872c00486c001..bb4ddec93a832 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.js +++ b/tests/baselines/reference/readonlyConstructorAssignment.js @@ -41,11 +41,16 @@ class E extends D { //// [readonlyConstructorAssignment.js] // Tests that readonly parameter properties behave like regular readonly properties -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(x) { this.x = x; diff --git a/tests/baselines/reference/recursiveBaseCheck3.js b/tests/baselines/reference/recursiveBaseCheck3.js index 250a9e0b6183a..84b40e2f0353c 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.js +++ b/tests/baselines/reference/recursiveBaseCheck3.js @@ -5,11 +5,16 @@ class C extends A { } (new C).blah; //// [recursiveBaseCheck3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function (_super) { __extends(A, _super); function A() { diff --git a/tests/baselines/reference/recursiveBaseCheck4.js b/tests/baselines/reference/recursiveBaseCheck4.js index 7f0c6b5f95d51..5db14dcf42d26 100644 --- a/tests/baselines/reference/recursiveBaseCheck4.js +++ b/tests/baselines/reference/recursiveBaseCheck4.js @@ -3,11 +3,16 @@ class M extends M { } (new M).blah; //// [recursiveBaseCheck4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M = (function (_super) { __extends(M, _super); function M() { diff --git a/tests/baselines/reference/recursiveBaseCheck6.js b/tests/baselines/reference/recursiveBaseCheck6.js index 53a608baeca64..e1ac79b3a6337 100644 --- a/tests/baselines/reference/recursiveBaseCheck6.js +++ b/tests/baselines/reference/recursiveBaseCheck6.js @@ -3,11 +3,16 @@ class S18 extends S18<{ S19: A; }>{ } (new S18()).blah; //// [recursiveBaseCheck6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var S18 = (function (_super) { __extends(S18, _super); function S18() { diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index 344750974cbfd..32a6a6c4de190 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -7,11 +7,16 @@ var x = new C2(); // Valid //// [recursiveBaseConstructorCreation1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js index 34aa110b7ee74..1c33cf9f2c7b5 100644 --- a/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js +++ b/tests/baselines/reference/recursiveClassInstantiationsWithDefaultConstructors.js @@ -10,11 +10,16 @@ export class MemberNameArray extends MemberName { //// [recursiveClassInstantiationsWithDefaultConstructors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var a = new TypeScript2.MemberNameArray(); var TypeScript2; (function (TypeScript2) { diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js b/tests/baselines/reference/recursiveClassReferenceTest.js index a2cf3319474e5..bb711d95ce73a 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js +++ b/tests/baselines/reference/recursiveClassReferenceTest.js @@ -105,11 +105,16 @@ module Sample.Thing.Languages.PlainText { //// [recursiveClassReferenceTest.js] // Scenario 1: Test reqursive function call with "this" parameter // Scenario 2: Test recursive function call with cast and "this" parameter -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Sample; (function (Sample) { var Actions; diff --git a/tests/baselines/reference/recursiveClassReferenceTest.js.map b/tests/baselines/reference/recursiveClassReferenceTest.js.map index 0b9bb8281bccf..b27f18ddffac6 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.js.map +++ b/tests/baselines/reference/recursiveClassReferenceTest.js.map @@ -1,2 +1,2 @@ //// [recursiveClassReferenceTest.js.map] -{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,MAAM,CAAC,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;;oBAQA,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file +{"version":3,"file":"recursiveClassReferenceTest.js","sourceRoot":"","sources":["recursiveClassReferenceTest.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,0EAA0E;;;;;;;;;;;AA8B1E,IAAO,MAAM,CAUZ;AAVD,WAAO,MAAM;IAAC,IAAA,OAAO,CAUpB;IAVa,WAAA,OAAO;QAAC,IAAA,KAAK,CAU1B;QAVqB,WAAA,OAAK;YAAC,IAAA,IAAI,CAU/B;YAV2B,WAAA,IAAI;gBAC/B;oBAAA;oBAQA,CAAC;oBANO,+BAAK,GAAZ,cAAiB,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBAExB,6BAAG,GAAV,UAAW,KAA6B;wBAEvC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBACF,sBAAC;gBAAD,CAAC,AARD,IAQC;gBARY,oBAAe,kBAQ3B,CAAA;YACF,CAAC,EAV2B,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAU/B;QAAD,CAAC,EAVqB,KAAK,GAAL,aAAK,KAAL,aAAK,QAU1B;IAAD,CAAC,EAVa,OAAO,GAAP,cAAO,KAAP,cAAO,QAUpB;AAAD,CAAC,EAVM,MAAM,KAAN,MAAM,QAUZ;AAED,WAAO,MAAM;IAAC,IAAA,KAAK,CAoBlB;IApBa,WAAA,KAAK;QAAC,IAAA,OAAO,CAoB1B;QApBmB,WAAA,OAAO;YAC1B;gBAKC,oBAAoB,SAAkC;oBAAlC,cAAS,GAAT,SAAS,CAAyB;oBAD9C,YAAO,GAAO,IAAI,CAAC;oBAEvB,aAAa;oBACb,SAAS,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;gBAC3C,CAAC;gBANM,wBAAG,GAAV,UAAW,MAAyC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;oBAAA,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAAA,CAAC,CAAA,CAAC;gBAQlF,+BAAU,GAAjB;oBACC,MAAM,CAAC,OAAO,CAAC;gBAChB,CAAC;gBAEM,4BAAO,GAAd;gBAEA,CAAC;gBAEF,iBAAC;YAAD,CAAC,AAlBD,IAkBC;YAlBY,kBAAU,aAkBtB,CAAA;QACF,CAAC,EApBmB,OAAO,GAAP,aAAO,KAAP,aAAO,QAoB1B;IAAD,CAAC,EApBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAoBlB;AAAD,CAAC,EApBM,MAAM,KAAN,MAAM,QAoBZ;AAGD;IAAA;IAAuF,CAAC;IAA3C,sCAAe,GAAtB,cAAmC,MAAM,CAAC,IAAI,CAAC,CAAA,CAAC;IAAC,mBAAC;AAAD,CAAC,AAAxF,IAAwF;AASxF,WAAO,MAAM;IAAC,IAAA,KAAK,CAwBlB;IAxBa,WAAA,KAAK;QAAC,IAAA,SAAS,CAwB5B;QAxBmB,WAAA,SAAS;YAAC,IAAA,SAAS,CAwBtC;YAxB6B,WAAA,SAAS;gBAEtC;oBACO,eAAoB,IAAW;wBAAX,SAAI,GAAJ,IAAI,CAAO;oBAAI,CAAC;oBACnC,qBAAK,GAAZ;wBACC,MAAM,CAAC,IAAI,CAAC;oBACb,CAAC;oBAEM,sBAAM,GAAb,UAAc,KAAY;wBACzB,MAAM,CAAC,IAAI,KAAK,KAAK,CAAC;oBACvB,CAAC;oBAEM,uBAAO,GAAd,cAA0B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;oBACzC,YAAC;gBAAD,CAAC,AAXD,IAWC;gBAXY,eAAK,QAWjB,CAAA;gBAED;oBAA0B,wBAAY;oBAAtC;;oBAQA,CAAC;oBANA,aAAa;oBACN,8BAAe,GAAtB;wBACC,MAAM,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;oBACxB,CAAC;oBAGF,WAAC;gBAAD,CAAC,AARD,CAA0B,YAAY,GAQrC;gBARY,cAAI,OAQhB,CAAA;YACF,CAAC,EAxB6B,SAAS,GAAT,mBAAS,KAAT,mBAAS,QAwBtC;QAAD,CAAC,EAxBmB,SAAS,GAAT,eAAS,KAAT,eAAS,QAwB5B;IAAD,CAAC,EAxBa,KAAK,GAAL,YAAK,KAAL,YAAK,QAwBlB;AAAD,CAAC,EAxBM,MAAM,KAAN,MAAM,QAwBZ"} \ No newline at end of file diff --git a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt index f99a062e2c635..10d04ca9719f5 100644 --- a/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt +++ b/tests/baselines/reference/recursiveClassReferenceTest.sourcemap.txt @@ -26,11 +26,16 @@ sourceFile:recursiveClassReferenceTest.ts 1->Emitted(2, 1) Source(2, 1) + SourceIndex(0) 2 >Emitted(2, 75) Source(2, 75) + SourceIndex(0) --- ->>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>var Sample; 1 > 2 >^^^^ @@ -81,10 +86,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(8, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(8, 5) Source(32, 8) + SourceIndex(0) -3 >Emitted(8, 11) Source(32, 14) + SourceIndex(0) -4 >Emitted(8, 12) Source(42, 2) + SourceIndex(0) +1 >Emitted(13, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(13, 5) Source(32, 8) + SourceIndex(0) +3 >Emitted(13, 11) Source(32, 14) + SourceIndex(0) +4 >Emitted(13, 12) Source(42, 2) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -93,9 +98,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 >module 3 > Sample -1->Emitted(9, 1) Source(32, 1) + SourceIndex(0) -2 >Emitted(9, 12) Source(32, 8) + SourceIndex(0) -3 >Emitted(9, 18) Source(32, 14) + SourceIndex(0) +1->Emitted(14, 1) Source(32, 1) + SourceIndex(0) +2 >Emitted(14, 12) Source(32, 8) + SourceIndex(0) +3 >Emitted(14, 18) Source(32, 14) + SourceIndex(0) --- >>> var Actions; 1 >^^^^ @@ -117,10 +122,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(10, 5) Source(32, 15) + SourceIndex(0) -2 >Emitted(10, 9) Source(32, 15) + SourceIndex(0) -3 >Emitted(10, 16) Source(32, 22) + SourceIndex(0) -4 >Emitted(10, 17) Source(42, 2) + SourceIndex(0) +1 >Emitted(15, 5) Source(32, 15) + SourceIndex(0) +2 >Emitted(15, 9) Source(32, 15) + SourceIndex(0) +3 >Emitted(15, 16) Source(32, 22) + SourceIndex(0) +4 >Emitted(15, 17) Source(42, 2) + SourceIndex(0) --- >>> (function (Actions) { 1->^^^^ @@ -129,9 +134,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Actions -1->Emitted(11, 5) Source(32, 15) + SourceIndex(0) -2 >Emitted(11, 16) Source(32, 15) + SourceIndex(0) -3 >Emitted(11, 23) Source(32, 22) + SourceIndex(0) +1->Emitted(16, 5) Source(32, 15) + SourceIndex(0) +2 >Emitted(16, 16) Source(32, 15) + SourceIndex(0) +3 >Emitted(16, 23) Source(32, 22) + SourceIndex(0) --- >>> var Thing; 1 >^^^^^^^^ @@ -153,10 +158,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(12, 9) Source(32, 23) + SourceIndex(0) -2 >Emitted(12, 13) Source(32, 23) + SourceIndex(0) -3 >Emitted(12, 18) Source(32, 28) + SourceIndex(0) -4 >Emitted(12, 19) Source(42, 2) + SourceIndex(0) +1 >Emitted(17, 9) Source(32, 23) + SourceIndex(0) +2 >Emitted(17, 13) Source(32, 23) + SourceIndex(0) +3 >Emitted(17, 18) Source(32, 28) + SourceIndex(0) +4 >Emitted(17, 19) Source(42, 2) + SourceIndex(0) --- >>> (function (Thing_1) { 1->^^^^^^^^ @@ -165,9 +170,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(13, 9) Source(32, 23) + SourceIndex(0) -2 >Emitted(13, 20) Source(32, 23) + SourceIndex(0) -3 >Emitted(13, 27) Source(32, 28) + SourceIndex(0) +1->Emitted(18, 9) Source(32, 23) + SourceIndex(0) +2 >Emitted(18, 20) Source(32, 23) + SourceIndex(0) +3 >Emitted(18, 27) Source(32, 28) + SourceIndex(0) --- >>> var Find; 1 >^^^^^^^^^^^^ @@ -189,10 +194,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(14, 13) Source(32, 29) + SourceIndex(0) -2 >Emitted(14, 17) Source(32, 29) + SourceIndex(0) -3 >Emitted(14, 21) Source(32, 33) + SourceIndex(0) -4 >Emitted(14, 22) Source(42, 2) + SourceIndex(0) +1 >Emitted(19, 13) Source(32, 29) + SourceIndex(0) +2 >Emitted(19, 17) Source(32, 29) + SourceIndex(0) +3 >Emitted(19, 21) Source(32, 33) + SourceIndex(0) +4 >Emitted(19, 22) Source(42, 2) + SourceIndex(0) --- >>> (function (Find) { 1->^^^^^^^^^^^^ @@ -202,22 +207,22 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Find -1->Emitted(15, 13) Source(32, 29) + SourceIndex(0) -2 >Emitted(15, 24) Source(32, 29) + SourceIndex(0) -3 >Emitted(15, 28) Source(32, 33) + SourceIndex(0) +1->Emitted(20, 13) Source(32, 29) + SourceIndex(0) +2 >Emitted(20, 24) Source(32, 29) + SourceIndex(0) +3 >Emitted(20, 28) Source(32, 33) + SourceIndex(0) --- >>> var StartFindAction = (function () { 1->^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > -1->Emitted(16, 17) Source(33, 2) + SourceIndex(0) +1->Emitted(21, 17) Source(33, 2) + SourceIndex(0) --- >>> function StartFindAction() { 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^-> 1-> -1->Emitted(17, 21) Source(33, 2) + SourceIndex(0) +1->Emitted(22, 21) Source(33, 2) + SourceIndex(0) --- >>> } 1->^^^^^^^^^^^^^^^^^^^^ @@ -233,8 +238,8 @@ sourceFile:recursiveClassReferenceTest.ts > } > 2 > } -1->Emitted(18, 21) Source(41, 2) + SourceIndex(0) -2 >Emitted(18, 22) Source(41, 3) + SourceIndex(0) +1->Emitted(23, 21) Source(41, 2) + SourceIndex(0) +2 >Emitted(23, 22) Source(41, 3) + SourceIndex(0) --- >>> StartFindAction.prototype.getId = function () { return "yo"; }; 1->^^^^^^^^^^^^^^^^^^^^ @@ -257,16 +262,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(19, 21) Source(35, 10) + SourceIndex(0) -2 >Emitted(19, 52) Source(35, 15) + SourceIndex(0) -3 >Emitted(19, 55) Source(35, 3) + SourceIndex(0) -4 >Emitted(19, 69) Source(35, 20) + SourceIndex(0) -5 >Emitted(19, 75) Source(35, 26) + SourceIndex(0) -6 >Emitted(19, 76) Source(35, 27) + SourceIndex(0) -7 >Emitted(19, 80) Source(35, 31) + SourceIndex(0) -8 >Emitted(19, 81) Source(35, 32) + SourceIndex(0) -9 >Emitted(19, 82) Source(35, 33) + SourceIndex(0) -10>Emitted(19, 83) Source(35, 34) + SourceIndex(0) +1->Emitted(24, 21) Source(35, 10) + SourceIndex(0) +2 >Emitted(24, 52) Source(35, 15) + SourceIndex(0) +3 >Emitted(24, 55) Source(35, 3) + SourceIndex(0) +4 >Emitted(24, 69) Source(35, 20) + SourceIndex(0) +5 >Emitted(24, 75) Source(35, 26) + SourceIndex(0) +6 >Emitted(24, 76) Source(35, 27) + SourceIndex(0) +7 >Emitted(24, 80) Source(35, 31) + SourceIndex(0) +8 >Emitted(24, 81) Source(35, 32) + SourceIndex(0) +9 >Emitted(24, 82) Source(35, 33) + SourceIndex(0) +10>Emitted(24, 83) Source(35, 34) + SourceIndex(0) --- >>> StartFindAction.prototype.run = function (Thing) { 1 >^^^^^^^^^^^^^^^^^^^^ @@ -281,11 +286,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public run( 5 > Thing:Sample.Thing.ICodeThing -1 >Emitted(20, 21) Source(37, 10) + SourceIndex(0) -2 >Emitted(20, 50) Source(37, 13) + SourceIndex(0) -3 >Emitted(20, 53) Source(37, 3) + SourceIndex(0) -4 >Emitted(20, 63) Source(37, 14) + SourceIndex(0) -5 >Emitted(20, 68) Source(37, 43) + SourceIndex(0) +1 >Emitted(25, 21) Source(37, 10) + SourceIndex(0) +2 >Emitted(25, 50) Source(37, 13) + SourceIndex(0) +3 >Emitted(25, 53) Source(37, 3) + SourceIndex(0) +4 >Emitted(25, 63) Source(37, 14) + SourceIndex(0) +5 >Emitted(25, 68) Source(37, 43) + SourceIndex(0) --- >>> return true; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -300,11 +305,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > true 5 > ; -1 >Emitted(21, 25) Source(39, 4) + SourceIndex(0) -2 >Emitted(21, 31) Source(39, 10) + SourceIndex(0) -3 >Emitted(21, 32) Source(39, 11) + SourceIndex(0) -4 >Emitted(21, 36) Source(39, 15) + SourceIndex(0) -5 >Emitted(21, 37) Source(39, 16) + SourceIndex(0) +1 >Emitted(26, 25) Source(39, 4) + SourceIndex(0) +2 >Emitted(26, 31) Source(39, 10) + SourceIndex(0) +3 >Emitted(26, 32) Source(39, 11) + SourceIndex(0) +4 >Emitted(26, 36) Source(39, 15) + SourceIndex(0) +5 >Emitted(26, 37) Source(39, 16) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -313,8 +318,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(22, 21) Source(40, 3) + SourceIndex(0) -2 >Emitted(22, 22) Source(40, 4) + SourceIndex(0) +1 >Emitted(27, 21) Source(40, 3) + SourceIndex(0) +2 >Emitted(27, 22) Source(40, 4) + SourceIndex(0) --- >>> return StartFindAction; 1->^^^^^^^^^^^^^^^^^^^^ @@ -322,8 +327,8 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > 2 > } -1->Emitted(23, 21) Source(41, 2) + SourceIndex(0) -2 >Emitted(23, 43) Source(41, 3) + SourceIndex(0) +1->Emitted(28, 21) Source(41, 2) + SourceIndex(0) +2 >Emitted(28, 43) Source(41, 3) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^^^^^ @@ -343,10 +348,10 @@ sourceFile:recursiveClassReferenceTest.ts > return true; > } > } -1 >Emitted(24, 17) Source(41, 2) + SourceIndex(0) -2 >Emitted(24, 18) Source(41, 3) + SourceIndex(0) -3 >Emitted(24, 18) Source(33, 2) + SourceIndex(0) -4 >Emitted(24, 22) Source(41, 3) + SourceIndex(0) +1 >Emitted(29, 17) Source(41, 2) + SourceIndex(0) +2 >Emitted(29, 18) Source(41, 3) + SourceIndex(0) +3 >Emitted(29, 18) Source(33, 2) + SourceIndex(0) +4 >Emitted(29, 22) Source(41, 3) + SourceIndex(0) --- >>> Find.StartFindAction = StartFindAction; 1->^^^^^^^^^^^^^^^^ @@ -366,10 +371,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > } 4 > -1->Emitted(25, 17) Source(33, 15) + SourceIndex(0) -2 >Emitted(25, 37) Source(33, 30) + SourceIndex(0) -3 >Emitted(25, 55) Source(41, 3) + SourceIndex(0) -4 >Emitted(25, 56) Source(41, 3) + SourceIndex(0) +1->Emitted(30, 17) Source(33, 15) + SourceIndex(0) +2 >Emitted(30, 37) Source(33, 30) + SourceIndex(0) +3 >Emitted(30, 55) Source(41, 3) + SourceIndex(0) +4 >Emitted(30, 56) Source(41, 3) + SourceIndex(0) --- >>> })(Find = Thing_1.Find || (Thing_1.Find = {})); 1->^^^^^^^^^^^^ @@ -401,15 +406,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(26, 13) Source(42, 1) + SourceIndex(0) -2 >Emitted(26, 14) Source(42, 2) + SourceIndex(0) -3 >Emitted(26, 16) Source(32, 29) + SourceIndex(0) -4 >Emitted(26, 20) Source(32, 33) + SourceIndex(0) -5 >Emitted(26, 23) Source(32, 29) + SourceIndex(0) -6 >Emitted(26, 35) Source(32, 33) + SourceIndex(0) -7 >Emitted(26, 40) Source(32, 29) + SourceIndex(0) -8 >Emitted(26, 52) Source(32, 33) + SourceIndex(0) -9 >Emitted(26, 60) Source(42, 2) + SourceIndex(0) +1->Emitted(31, 13) Source(42, 1) + SourceIndex(0) +2 >Emitted(31, 14) Source(42, 2) + SourceIndex(0) +3 >Emitted(31, 16) Source(32, 29) + SourceIndex(0) +4 >Emitted(31, 20) Source(32, 33) + SourceIndex(0) +5 >Emitted(31, 23) Source(32, 29) + SourceIndex(0) +6 >Emitted(31, 35) Source(32, 33) + SourceIndex(0) +7 >Emitted(31, 40) Source(32, 29) + SourceIndex(0) +8 >Emitted(31, 52) Source(32, 33) + SourceIndex(0) +9 >Emitted(31, 60) Source(42, 2) + SourceIndex(0) --- >>> })(Thing = Actions.Thing || (Actions.Thing = {})); 1 >^^^^^^^^ @@ -441,15 +446,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(27, 9) Source(42, 1) + SourceIndex(0) -2 >Emitted(27, 10) Source(42, 2) + SourceIndex(0) -3 >Emitted(27, 12) Source(32, 23) + SourceIndex(0) -4 >Emitted(27, 17) Source(32, 28) + SourceIndex(0) -5 >Emitted(27, 20) Source(32, 23) + SourceIndex(0) -6 >Emitted(27, 33) Source(32, 28) + SourceIndex(0) -7 >Emitted(27, 38) Source(32, 23) + SourceIndex(0) -8 >Emitted(27, 51) Source(32, 28) + SourceIndex(0) -9 >Emitted(27, 59) Source(42, 2) + SourceIndex(0) +1 >Emitted(32, 9) Source(42, 1) + SourceIndex(0) +2 >Emitted(32, 10) Source(42, 2) + SourceIndex(0) +3 >Emitted(32, 12) Source(32, 23) + SourceIndex(0) +4 >Emitted(32, 17) Source(32, 28) + SourceIndex(0) +5 >Emitted(32, 20) Source(32, 23) + SourceIndex(0) +6 >Emitted(32, 33) Source(32, 28) + SourceIndex(0) +7 >Emitted(32, 38) Source(32, 23) + SourceIndex(0) +8 >Emitted(32, 51) Source(32, 28) + SourceIndex(0) +9 >Emitted(32, 59) Source(42, 2) + SourceIndex(0) --- >>> })(Actions = Sample.Actions || (Sample.Actions = {})); 1->^^^^ @@ -480,15 +485,15 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1->Emitted(28, 5) Source(42, 1) + SourceIndex(0) -2 >Emitted(28, 6) Source(42, 2) + SourceIndex(0) -3 >Emitted(28, 8) Source(32, 15) + SourceIndex(0) -4 >Emitted(28, 15) Source(32, 22) + SourceIndex(0) -5 >Emitted(28, 18) Source(32, 15) + SourceIndex(0) -6 >Emitted(28, 32) Source(32, 22) + SourceIndex(0) -7 >Emitted(28, 37) Source(32, 15) + SourceIndex(0) -8 >Emitted(28, 51) Source(32, 22) + SourceIndex(0) -9 >Emitted(28, 59) Source(42, 2) + SourceIndex(0) +1->Emitted(33, 5) Source(42, 1) + SourceIndex(0) +2 >Emitted(33, 6) Source(42, 2) + SourceIndex(0) +3 >Emitted(33, 8) Source(32, 15) + SourceIndex(0) +4 >Emitted(33, 15) Source(32, 22) + SourceIndex(0) +5 >Emitted(33, 18) Source(32, 15) + SourceIndex(0) +6 >Emitted(33, 32) Source(32, 22) + SourceIndex(0) +7 >Emitted(33, 37) Source(32, 15) + SourceIndex(0) +8 >Emitted(33, 51) Source(32, 22) + SourceIndex(0) +9 >Emitted(33, 59) Source(42, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -515,13 +520,13 @@ sourceFile:recursiveClassReferenceTest.ts > } > } > } -1 >Emitted(29, 1) Source(42, 1) + SourceIndex(0) -2 >Emitted(29, 2) Source(42, 2) + SourceIndex(0) -3 >Emitted(29, 4) Source(32, 8) + SourceIndex(0) -4 >Emitted(29, 10) Source(32, 14) + SourceIndex(0) -5 >Emitted(29, 15) Source(32, 8) + SourceIndex(0) -6 >Emitted(29, 21) Source(32, 14) + SourceIndex(0) -7 >Emitted(29, 29) Source(42, 2) + SourceIndex(0) +1 >Emitted(34, 1) Source(42, 1) + SourceIndex(0) +2 >Emitted(34, 2) Source(42, 2) + SourceIndex(0) +3 >Emitted(34, 4) Source(32, 8) + SourceIndex(0) +4 >Emitted(34, 10) Source(32, 14) + SourceIndex(0) +5 >Emitted(34, 15) Source(32, 8) + SourceIndex(0) +6 >Emitted(34, 21) Source(32, 14) + SourceIndex(0) +7 >Emitted(34, 29) Source(42, 2) + SourceIndex(0) --- >>>(function (Sample) { 1 > @@ -532,9 +537,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 >module 3 > Sample -1 >Emitted(30, 1) Source(44, 1) + SourceIndex(0) -2 >Emitted(30, 12) Source(44, 8) + SourceIndex(0) -3 >Emitted(30, 18) Source(44, 14) + SourceIndex(0) +1 >Emitted(35, 1) Source(44, 1) + SourceIndex(0) +2 >Emitted(35, 12) Source(44, 8) + SourceIndex(0) +3 >Emitted(35, 18) Source(44, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -566,10 +571,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(31, 5) Source(44, 15) + SourceIndex(0) -2 >Emitted(31, 9) Source(44, 15) + SourceIndex(0) -3 >Emitted(31, 14) Source(44, 20) + SourceIndex(0) -4 >Emitted(31, 15) Source(64, 2) + SourceIndex(0) +1 >Emitted(36, 5) Source(44, 15) + SourceIndex(0) +2 >Emitted(36, 9) Source(44, 15) + SourceIndex(0) +3 >Emitted(36, 14) Source(44, 20) + SourceIndex(0) +4 >Emitted(36, 15) Source(64, 2) + SourceIndex(0) --- >>> (function (Thing) { 1->^^^^ @@ -579,9 +584,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(32, 5) Source(44, 15) + SourceIndex(0) -2 >Emitted(32, 16) Source(44, 15) + SourceIndex(0) -3 >Emitted(32, 21) Source(44, 20) + SourceIndex(0) +1->Emitted(37, 5) Source(44, 15) + SourceIndex(0) +2 >Emitted(37, 16) Source(44, 15) + SourceIndex(0) +3 >Emitted(37, 21) Source(44, 20) + SourceIndex(0) --- >>> var Widgets; 1->^^^^^^^^ @@ -613,10 +618,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(33, 9) Source(44, 21) + SourceIndex(0) -2 >Emitted(33, 13) Source(44, 21) + SourceIndex(0) -3 >Emitted(33, 20) Source(44, 28) + SourceIndex(0) -4 >Emitted(33, 21) Source(64, 2) + SourceIndex(0) +1->Emitted(38, 9) Source(44, 21) + SourceIndex(0) +2 >Emitted(38, 13) Source(44, 21) + SourceIndex(0) +3 >Emitted(38, 20) Source(44, 28) + SourceIndex(0) +4 >Emitted(38, 21) Source(64, 2) + SourceIndex(0) --- >>> (function (Widgets) { 1->^^^^^^^^ @@ -626,16 +631,16 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Widgets -1->Emitted(34, 9) Source(44, 21) + SourceIndex(0) -2 >Emitted(34, 20) Source(44, 21) + SourceIndex(0) -3 >Emitted(34, 27) Source(44, 28) + SourceIndex(0) +1->Emitted(39, 9) Source(44, 21) + SourceIndex(0) +2 >Emitted(39, 20) Source(44, 21) + SourceIndex(0) +3 >Emitted(39, 27) Source(44, 28) + SourceIndex(0) --- >>> var FindWidget = (function () { 1->^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> { > -1->Emitted(35, 13) Source(45, 2) + SourceIndex(0) +1->Emitted(40, 13) Source(45, 2) + SourceIndex(0) --- >>> function FindWidget(codeThing) { 1->^^^^^^^^^^^^^^^^ @@ -650,9 +655,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > codeThing: Sample.Thing.ICodeThing -1->Emitted(36, 17) Source(50, 3) + SourceIndex(0) -2 >Emitted(36, 37) Source(50, 23) + SourceIndex(0) -3 >Emitted(36, 46) Source(50, 57) + SourceIndex(0) +1->Emitted(41, 17) Source(50, 3) + SourceIndex(0) +2 >Emitted(41, 37) Source(50, 23) + SourceIndex(0) +3 >Emitted(41, 46) Source(50, 57) + SourceIndex(0) --- >>> this.codeThing = codeThing; 1->^^^^^^^^^^^^^^^^^^^^ @@ -665,11 +670,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > codeThing 5 > : Sample.Thing.ICodeThing -1->Emitted(37, 21) Source(50, 23) + SourceIndex(0) -2 >Emitted(37, 35) Source(50, 32) + SourceIndex(0) -3 >Emitted(37, 38) Source(50, 23) + SourceIndex(0) -4 >Emitted(37, 47) Source(50, 32) + SourceIndex(0) -5 >Emitted(37, 48) Source(50, 57) + SourceIndex(0) +1->Emitted(42, 21) Source(50, 23) + SourceIndex(0) +2 >Emitted(42, 35) Source(50, 32) + SourceIndex(0) +3 >Emitted(42, 38) Source(50, 23) + SourceIndex(0) +4 >Emitted(42, 47) Source(50, 32) + SourceIndex(0) +5 >Emitted(42, 48) Source(50, 57) + SourceIndex(0) --- >>> this.domNode = null; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -682,11 +687,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > :any = 4 > null 5 > ; -1 >Emitted(38, 21) Source(49, 11) + SourceIndex(0) -2 >Emitted(38, 33) Source(49, 18) + SourceIndex(0) -3 >Emitted(38, 36) Source(49, 25) + SourceIndex(0) -4 >Emitted(38, 40) Source(49, 29) + SourceIndex(0) -5 >Emitted(38, 41) Source(49, 30) + SourceIndex(0) +1 >Emitted(43, 21) Source(49, 11) + SourceIndex(0) +2 >Emitted(43, 33) Source(49, 18) + SourceIndex(0) +3 >Emitted(43, 36) Source(49, 25) + SourceIndex(0) +4 >Emitted(43, 40) Source(49, 29) + SourceIndex(0) +5 >Emitted(43, 41) Source(49, 30) + SourceIndex(0) --- >>> // scenario 1 1 >^^^^^^^^^^^^^^^^^^^^ @@ -696,8 +701,8 @@ sourceFile:recursiveClassReferenceTest.ts > constructor(private codeThing: Sample.Thing.ICodeThing) { > 2 > // scenario 1 -1 >Emitted(39, 21) Source(51, 7) + SourceIndex(0) -2 >Emitted(39, 34) Source(51, 20) + SourceIndex(0) +1 >Emitted(44, 21) Source(51, 7) + SourceIndex(0) +2 >Emitted(44, 34) Source(51, 20) + SourceIndex(0) --- >>> codeThing.addWidget("addWidget", this); 1->^^^^^^^^^^^^^^^^^^^^ @@ -721,16 +726,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > this 9 > ) 10> ; -1->Emitted(40, 21) Source(52, 7) + SourceIndex(0) -2 >Emitted(40, 30) Source(52, 16) + SourceIndex(0) -3 >Emitted(40, 31) Source(52, 17) + SourceIndex(0) -4 >Emitted(40, 40) Source(52, 26) + SourceIndex(0) -5 >Emitted(40, 41) Source(52, 27) + SourceIndex(0) -6 >Emitted(40, 52) Source(52, 38) + SourceIndex(0) -7 >Emitted(40, 54) Source(52, 40) + SourceIndex(0) -8 >Emitted(40, 58) Source(52, 44) + SourceIndex(0) -9 >Emitted(40, 59) Source(52, 45) + SourceIndex(0) -10>Emitted(40, 60) Source(52, 46) + SourceIndex(0) +1->Emitted(45, 21) Source(52, 7) + SourceIndex(0) +2 >Emitted(45, 30) Source(52, 16) + SourceIndex(0) +3 >Emitted(45, 31) Source(52, 17) + SourceIndex(0) +4 >Emitted(45, 40) Source(52, 26) + SourceIndex(0) +5 >Emitted(45, 41) Source(52, 27) + SourceIndex(0) +6 >Emitted(45, 52) Source(52, 38) + SourceIndex(0) +7 >Emitted(45, 54) Source(52, 40) + SourceIndex(0) +8 >Emitted(45, 58) Source(52, 44) + SourceIndex(0) +9 >Emitted(45, 59) Source(52, 45) + SourceIndex(0) +10>Emitted(45, 60) Source(52, 46) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^^^^^ @@ -739,8 +744,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(41, 17) Source(53, 3) + SourceIndex(0) -2 >Emitted(41, 18) Source(53, 4) + SourceIndex(0) +1 >Emitted(46, 17) Source(53, 3) + SourceIndex(0) +2 >Emitted(46, 18) Source(53, 4) + SourceIndex(0) --- >>> FindWidget.prototype.gar = function (runner) { if (true) { 1->^^^^^^^^^^^^^^^^ @@ -769,19 +774,19 @@ sourceFile:recursiveClassReferenceTest.ts 11> ) 12> 13> { -1->Emitted(42, 17) Source(47, 10) + SourceIndex(0) -2 >Emitted(42, 41) Source(47, 13) + SourceIndex(0) -3 >Emitted(42, 44) Source(47, 3) + SourceIndex(0) -4 >Emitted(42, 54) Source(47, 14) + SourceIndex(0) -5 >Emitted(42, 60) Source(47, 55) + SourceIndex(0) -6 >Emitted(42, 64) Source(47, 59) + SourceIndex(0) -7 >Emitted(42, 66) Source(47, 61) + SourceIndex(0) -8 >Emitted(42, 67) Source(47, 62) + SourceIndex(0) -9 >Emitted(42, 68) Source(47, 63) + SourceIndex(0) -10>Emitted(42, 72) Source(47, 67) + SourceIndex(0) -11>Emitted(42, 73) Source(47, 68) + SourceIndex(0) -12>Emitted(42, 74) Source(47, 69) + SourceIndex(0) -13>Emitted(42, 75) Source(47, 70) + SourceIndex(0) +1->Emitted(47, 17) Source(47, 10) + SourceIndex(0) +2 >Emitted(47, 41) Source(47, 13) + SourceIndex(0) +3 >Emitted(47, 44) Source(47, 3) + SourceIndex(0) +4 >Emitted(47, 54) Source(47, 14) + SourceIndex(0) +5 >Emitted(47, 60) Source(47, 55) + SourceIndex(0) +6 >Emitted(47, 64) Source(47, 59) + SourceIndex(0) +7 >Emitted(47, 66) Source(47, 61) + SourceIndex(0) +8 >Emitted(47, 67) Source(47, 62) + SourceIndex(0) +9 >Emitted(47, 68) Source(47, 63) + SourceIndex(0) +10>Emitted(47, 72) Source(47, 67) + SourceIndex(0) +11>Emitted(47, 73) Source(47, 68) + SourceIndex(0) +12>Emitted(47, 74) Source(47, 69) + SourceIndex(0) +13>Emitted(47, 75) Source(47, 70) + SourceIndex(0) --- >>> return runner(this); 1 >^^^^^^^^^^^^^^^^^^^^ @@ -800,14 +805,14 @@ sourceFile:recursiveClassReferenceTest.ts 6 > this 7 > ) 8 > ; -1 >Emitted(43, 21) Source(47, 70) + SourceIndex(0) -2 >Emitted(43, 27) Source(47, 76) + SourceIndex(0) -3 >Emitted(43, 28) Source(47, 77) + SourceIndex(0) -4 >Emitted(43, 34) Source(47, 83) + SourceIndex(0) -5 >Emitted(43, 35) Source(47, 84) + SourceIndex(0) -6 >Emitted(43, 39) Source(47, 88) + SourceIndex(0) -7 >Emitted(43, 40) Source(47, 89) + SourceIndex(0) -8 >Emitted(43, 41) Source(47, 90) + SourceIndex(0) +1 >Emitted(48, 21) Source(47, 70) + SourceIndex(0) +2 >Emitted(48, 27) Source(47, 76) + SourceIndex(0) +3 >Emitted(48, 28) Source(47, 77) + SourceIndex(0) +4 >Emitted(48, 34) Source(47, 83) + SourceIndex(0) +5 >Emitted(48, 35) Source(47, 84) + SourceIndex(0) +6 >Emitted(48, 39) Source(47, 88) + SourceIndex(0) +7 >Emitted(48, 40) Source(47, 89) + SourceIndex(0) +8 >Emitted(48, 41) Source(47, 90) + SourceIndex(0) --- >>> } }; 1 >^^^^^^^^^^^^^^^^ @@ -819,10 +824,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 > } 3 > 4 > } -1 >Emitted(44, 17) Source(47, 90) + SourceIndex(0) -2 >Emitted(44, 18) Source(47, 91) + SourceIndex(0) -3 >Emitted(44, 19) Source(47, 91) + SourceIndex(0) -4 >Emitted(44, 20) Source(47, 92) + SourceIndex(0) +1 >Emitted(49, 17) Source(47, 90) + SourceIndex(0) +2 >Emitted(49, 18) Source(47, 91) + SourceIndex(0) +3 >Emitted(49, 19) Source(47, 91) + SourceIndex(0) +4 >Emitted(49, 20) Source(47, 92) + SourceIndex(0) --- >>> FindWidget.prototype.getDomNode = function () { 1->^^^^^^^^^^^^^^^^ @@ -839,9 +844,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getDomNode 3 > -1->Emitted(45, 17) Source(55, 10) + SourceIndex(0) -2 >Emitted(45, 48) Source(55, 20) + SourceIndex(0) -3 >Emitted(45, 51) Source(55, 3) + SourceIndex(0) +1->Emitted(50, 17) Source(55, 10) + SourceIndex(0) +2 >Emitted(50, 48) Source(55, 20) + SourceIndex(0) +3 >Emitted(50, 51) Source(55, 3) + SourceIndex(0) --- >>> return domNode; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -855,11 +860,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > domNode 5 > ; -1 >Emitted(46, 21) Source(56, 4) + SourceIndex(0) -2 >Emitted(46, 27) Source(56, 10) + SourceIndex(0) -3 >Emitted(46, 28) Source(56, 11) + SourceIndex(0) -4 >Emitted(46, 35) Source(56, 18) + SourceIndex(0) -5 >Emitted(46, 36) Source(56, 19) + SourceIndex(0) +1 >Emitted(51, 21) Source(56, 4) + SourceIndex(0) +2 >Emitted(51, 27) Source(56, 10) + SourceIndex(0) +3 >Emitted(51, 28) Source(56, 11) + SourceIndex(0) +4 >Emitted(51, 35) Source(56, 18) + SourceIndex(0) +5 >Emitted(51, 36) Source(56, 19) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -868,8 +873,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(47, 17) Source(57, 3) + SourceIndex(0) -2 >Emitted(47, 18) Source(57, 4) + SourceIndex(0) +1 >Emitted(52, 17) Source(57, 3) + SourceIndex(0) +2 >Emitted(52, 18) Source(57, 4) + SourceIndex(0) --- >>> FindWidget.prototype.destroy = function () { 1->^^^^^^^^^^^^^^^^ @@ -880,9 +885,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > destroy 3 > -1->Emitted(48, 17) Source(59, 10) + SourceIndex(0) -2 >Emitted(48, 45) Source(59, 17) + SourceIndex(0) -3 >Emitted(48, 48) Source(59, 3) + SourceIndex(0) +1->Emitted(53, 17) Source(59, 10) + SourceIndex(0) +2 >Emitted(53, 45) Source(59, 17) + SourceIndex(0) +3 >Emitted(53, 48) Source(59, 3) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^ @@ -892,8 +897,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1 >Emitted(49, 17) Source(61, 3) + SourceIndex(0) -2 >Emitted(49, 18) Source(61, 4) + SourceIndex(0) +1 >Emitted(54, 17) Source(61, 3) + SourceIndex(0) +2 >Emitted(54, 18) Source(61, 4) + SourceIndex(0) --- >>> return FindWidget; 1->^^^^^^^^^^^^^^^^ @@ -902,8 +907,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(50, 17) Source(63, 2) + SourceIndex(0) -2 >Emitted(50, 34) Source(63, 3) + SourceIndex(0) +1->Emitted(55, 17) Source(63, 2) + SourceIndex(0) +2 >Emitted(55, 34) Source(63, 3) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^ @@ -933,10 +938,10 @@ sourceFile:recursiveClassReferenceTest.ts > } > > } -1 >Emitted(51, 13) Source(63, 2) + SourceIndex(0) -2 >Emitted(51, 14) Source(63, 3) + SourceIndex(0) -3 >Emitted(51, 14) Source(45, 2) + SourceIndex(0) -4 >Emitted(51, 18) Source(63, 3) + SourceIndex(0) +1 >Emitted(56, 13) Source(63, 2) + SourceIndex(0) +2 >Emitted(56, 14) Source(63, 3) + SourceIndex(0) +3 >Emitted(56, 14) Source(45, 2) + SourceIndex(0) +4 >Emitted(56, 18) Source(63, 3) + SourceIndex(0) --- >>> Widgets.FindWidget = FindWidget; 1->^^^^^^^^^^^^ @@ -966,10 +971,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(52, 13) Source(45, 15) + SourceIndex(0) -2 >Emitted(52, 31) Source(45, 25) + SourceIndex(0) -3 >Emitted(52, 44) Source(63, 3) + SourceIndex(0) -4 >Emitted(52, 45) Source(63, 3) + SourceIndex(0) +1->Emitted(57, 13) Source(45, 15) + SourceIndex(0) +2 >Emitted(57, 31) Source(45, 25) + SourceIndex(0) +3 >Emitted(57, 44) Source(63, 3) + SourceIndex(0) +4 >Emitted(57, 45) Source(63, 3) + SourceIndex(0) --- >>> })(Widgets = Thing.Widgets || (Thing.Widgets = {})); 1->^^^^^^^^ @@ -1011,15 +1016,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(53, 9) Source(64, 1) + SourceIndex(0) -2 >Emitted(53, 10) Source(64, 2) + SourceIndex(0) -3 >Emitted(53, 12) Source(44, 21) + SourceIndex(0) -4 >Emitted(53, 19) Source(44, 28) + SourceIndex(0) -5 >Emitted(53, 22) Source(44, 21) + SourceIndex(0) -6 >Emitted(53, 35) Source(44, 28) + SourceIndex(0) -7 >Emitted(53, 40) Source(44, 21) + SourceIndex(0) -8 >Emitted(53, 53) Source(44, 28) + SourceIndex(0) -9 >Emitted(53, 61) Source(64, 2) + SourceIndex(0) +1->Emitted(58, 9) Source(64, 1) + SourceIndex(0) +2 >Emitted(58, 10) Source(64, 2) + SourceIndex(0) +3 >Emitted(58, 12) Source(44, 21) + SourceIndex(0) +4 >Emitted(58, 19) Source(44, 28) + SourceIndex(0) +5 >Emitted(58, 22) Source(44, 21) + SourceIndex(0) +6 >Emitted(58, 35) Source(44, 28) + SourceIndex(0) +7 >Emitted(58, 40) Source(44, 21) + SourceIndex(0) +8 >Emitted(58, 53) Source(44, 28) + SourceIndex(0) +9 >Emitted(58, 61) Source(64, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1060,15 +1065,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(54, 5) Source(64, 1) + SourceIndex(0) -2 >Emitted(54, 6) Source(64, 2) + SourceIndex(0) -3 >Emitted(54, 8) Source(44, 15) + SourceIndex(0) -4 >Emitted(54, 13) Source(44, 20) + SourceIndex(0) -5 >Emitted(54, 16) Source(44, 15) + SourceIndex(0) -6 >Emitted(54, 28) Source(44, 20) + SourceIndex(0) -7 >Emitted(54, 33) Source(44, 15) + SourceIndex(0) -8 >Emitted(54, 45) Source(44, 20) + SourceIndex(0) -9 >Emitted(54, 53) Source(64, 2) + SourceIndex(0) +1 >Emitted(59, 5) Source(64, 1) + SourceIndex(0) +2 >Emitted(59, 6) Source(64, 2) + SourceIndex(0) +3 >Emitted(59, 8) Source(44, 15) + SourceIndex(0) +4 >Emitted(59, 13) Source(44, 20) + SourceIndex(0) +5 >Emitted(59, 16) Source(44, 15) + SourceIndex(0) +6 >Emitted(59, 28) Source(44, 20) + SourceIndex(0) +7 >Emitted(59, 33) Source(44, 15) + SourceIndex(0) +8 >Emitted(59, 45) Source(44, 20) + SourceIndex(0) +9 >Emitted(59, 53) Source(64, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -1106,13 +1111,13 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(55, 1) Source(64, 1) + SourceIndex(0) -2 >Emitted(55, 2) Source(64, 2) + SourceIndex(0) -3 >Emitted(55, 4) Source(44, 8) + SourceIndex(0) -4 >Emitted(55, 10) Source(44, 14) + SourceIndex(0) -5 >Emitted(55, 15) Source(44, 8) + SourceIndex(0) -6 >Emitted(55, 21) Source(44, 14) + SourceIndex(0) -7 >Emitted(55, 29) Source(64, 2) + SourceIndex(0) +1 >Emitted(60, 1) Source(64, 1) + SourceIndex(0) +2 >Emitted(60, 2) Source(64, 2) + SourceIndex(0) +3 >Emitted(60, 4) Source(44, 8) + SourceIndex(0) +4 >Emitted(60, 10) Source(44, 14) + SourceIndex(0) +5 >Emitted(60, 15) Source(44, 8) + SourceIndex(0) +6 >Emitted(60, 21) Source(44, 14) + SourceIndex(0) +7 >Emitted(60, 29) Source(64, 2) + SourceIndex(0) --- >>>var AbstractMode = (function () { 1-> @@ -1121,13 +1126,13 @@ sourceFile:recursiveClassReferenceTest.ts > >interface IMode { getInitialState(): IState;} > -1->Emitted(56, 1) Source(67, 1) + SourceIndex(0) +1->Emitted(61, 1) Source(67, 1) + SourceIndex(0) --- >>> function AbstractMode() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(57, 5) Source(67, 1) + SourceIndex(0) +1->Emitted(62, 5) Source(67, 1) + SourceIndex(0) --- >>> } 1->^^^^ @@ -1135,8 +1140,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1->class AbstractMode implements IMode { public getInitialState(): IState { return null;} 2 > } -1->Emitted(58, 5) Source(67, 88) + SourceIndex(0) -2 >Emitted(58, 6) Source(67, 89) + SourceIndex(0) +1->Emitted(63, 5) Source(67, 88) + SourceIndex(0) +2 >Emitted(63, 6) Source(67, 89) + SourceIndex(0) --- >>> AbstractMode.prototype.getInitialState = function () { return null; }; 1->^^^^ @@ -1159,24 +1164,24 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(59, 5) Source(67, 46) + SourceIndex(0) -2 >Emitted(59, 43) Source(67, 61) + SourceIndex(0) -3 >Emitted(59, 46) Source(67, 39) + SourceIndex(0) -4 >Emitted(59, 60) Source(67, 74) + SourceIndex(0) -5 >Emitted(59, 66) Source(67, 80) + SourceIndex(0) -6 >Emitted(59, 67) Source(67, 81) + SourceIndex(0) -7 >Emitted(59, 71) Source(67, 85) + SourceIndex(0) -8 >Emitted(59, 72) Source(67, 86) + SourceIndex(0) -9 >Emitted(59, 73) Source(67, 86) + SourceIndex(0) -10>Emitted(59, 74) Source(67, 87) + SourceIndex(0) +1->Emitted(64, 5) Source(67, 46) + SourceIndex(0) +2 >Emitted(64, 43) Source(67, 61) + SourceIndex(0) +3 >Emitted(64, 46) Source(67, 39) + SourceIndex(0) +4 >Emitted(64, 60) Source(67, 74) + SourceIndex(0) +5 >Emitted(64, 66) Source(67, 80) + SourceIndex(0) +6 >Emitted(64, 67) Source(67, 81) + SourceIndex(0) +7 >Emitted(64, 71) Source(67, 85) + SourceIndex(0) +8 >Emitted(64, 72) Source(67, 86) + SourceIndex(0) +9 >Emitted(64, 73) Source(67, 86) + SourceIndex(0) +10>Emitted(64, 74) Source(67, 87) + SourceIndex(0) --- >>> return AbstractMode; 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^ 1 > 2 > } -1 >Emitted(60, 5) Source(67, 88) + SourceIndex(0) -2 >Emitted(60, 24) Source(67, 89) + SourceIndex(0) +1 >Emitted(65, 5) Source(67, 88) + SourceIndex(0) +2 >Emitted(65, 24) Source(67, 89) + SourceIndex(0) --- >>>}()); 1 > @@ -1188,10 +1193,10 @@ sourceFile:recursiveClassReferenceTest.ts 2 >} 3 > 4 > class AbstractMode implements IMode { public getInitialState(): IState { return null;} } -1 >Emitted(61, 1) Source(67, 88) + SourceIndex(0) -2 >Emitted(61, 2) Source(67, 89) + SourceIndex(0) -3 >Emitted(61, 2) Source(67, 1) + SourceIndex(0) -4 >Emitted(61, 6) Source(67, 89) + SourceIndex(0) +1 >Emitted(66, 1) Source(67, 88) + SourceIndex(0) +2 >Emitted(66, 2) Source(67, 89) + SourceIndex(0) +3 >Emitted(66, 2) Source(67, 1) + SourceIndex(0) +4 >Emitted(66, 6) Source(67, 89) + SourceIndex(0) --- >>>(function (Sample) { 1-> @@ -1209,9 +1214,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 >module 3 > Sample -1->Emitted(62, 1) Source(76, 1) + SourceIndex(0) -2 >Emitted(62, 12) Source(76, 8) + SourceIndex(0) -3 >Emitted(62, 18) Source(76, 14) + SourceIndex(0) +1->Emitted(67, 1) Source(76, 1) + SourceIndex(0) +2 >Emitted(67, 12) Source(76, 8) + SourceIndex(0) +3 >Emitted(67, 18) Source(76, 14) + SourceIndex(0) --- >>> var Thing; 1 >^^^^ @@ -1247,10 +1252,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(63, 5) Source(76, 15) + SourceIndex(0) -2 >Emitted(63, 9) Source(76, 15) + SourceIndex(0) -3 >Emitted(63, 14) Source(76, 20) + SourceIndex(0) -4 >Emitted(63, 15) Source(100, 2) + SourceIndex(0) +1 >Emitted(68, 5) Source(76, 15) + SourceIndex(0) +2 >Emitted(68, 9) Source(76, 15) + SourceIndex(0) +3 >Emitted(68, 14) Source(76, 20) + SourceIndex(0) +4 >Emitted(68, 15) Source(100, 2) + SourceIndex(0) --- >>> (function (Thing) { 1->^^^^ @@ -1260,9 +1265,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Thing -1->Emitted(64, 5) Source(76, 15) + SourceIndex(0) -2 >Emitted(64, 16) Source(76, 15) + SourceIndex(0) -3 >Emitted(64, 21) Source(76, 20) + SourceIndex(0) +1->Emitted(69, 5) Source(76, 15) + SourceIndex(0) +2 >Emitted(69, 16) Source(76, 15) + SourceIndex(0) +3 >Emitted(69, 21) Source(76, 20) + SourceIndex(0) --- >>> var Languages; 1->^^^^^^^^ @@ -1298,10 +1303,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(65, 9) Source(76, 21) + SourceIndex(0) -2 >Emitted(65, 13) Source(76, 21) + SourceIndex(0) -3 >Emitted(65, 22) Source(76, 30) + SourceIndex(0) -4 >Emitted(65, 23) Source(100, 2) + SourceIndex(0) +1->Emitted(70, 9) Source(76, 21) + SourceIndex(0) +2 >Emitted(70, 13) Source(76, 21) + SourceIndex(0) +3 >Emitted(70, 22) Source(76, 30) + SourceIndex(0) +4 >Emitted(70, 23) Source(100, 2) + SourceIndex(0) --- >>> (function (Languages) { 1->^^^^^^^^ @@ -1310,9 +1315,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > Languages -1->Emitted(66, 9) Source(76, 21) + SourceIndex(0) -2 >Emitted(66, 20) Source(76, 21) + SourceIndex(0) -3 >Emitted(66, 29) Source(76, 30) + SourceIndex(0) +1->Emitted(71, 9) Source(76, 21) + SourceIndex(0) +2 >Emitted(71, 20) Source(76, 21) + SourceIndex(0) +3 >Emitted(71, 29) Source(76, 30) + SourceIndex(0) --- >>> var PlainText; 1 >^^^^^^^^^^^^ @@ -1348,10 +1353,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(67, 13) Source(76, 31) + SourceIndex(0) -2 >Emitted(67, 17) Source(76, 31) + SourceIndex(0) -3 >Emitted(67, 26) Source(76, 40) + SourceIndex(0) -4 >Emitted(67, 27) Source(100, 2) + SourceIndex(0) +1 >Emitted(72, 13) Source(76, 31) + SourceIndex(0) +2 >Emitted(72, 17) Source(76, 31) + SourceIndex(0) +3 >Emitted(72, 26) Source(76, 40) + SourceIndex(0) +4 >Emitted(72, 27) Source(100, 2) + SourceIndex(0) --- >>> (function (PlainText) { 1->^^^^^^^^^^^^ @@ -1361,9 +1366,9 @@ sourceFile:recursiveClassReferenceTest.ts 1-> 2 > 3 > PlainText -1->Emitted(68, 13) Source(76, 31) + SourceIndex(0) -2 >Emitted(68, 24) Source(76, 31) + SourceIndex(0) -3 >Emitted(68, 33) Source(76, 40) + SourceIndex(0) +1->Emitted(73, 13) Source(76, 31) + SourceIndex(0) +2 >Emitted(73, 24) Source(76, 31) + SourceIndex(0) +3 >Emitted(73, 33) Source(76, 40) + SourceIndex(0) --- >>> var State = (function () { 1->^^^^^^^^^^^^^^^^ @@ -1371,7 +1376,7 @@ sourceFile:recursiveClassReferenceTest.ts 1-> { > > -1->Emitted(69, 17) Source(78, 2) + SourceIndex(0) +1->Emitted(74, 17) Source(78, 2) + SourceIndex(0) --- >>> function State(mode) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1382,9 +1387,9 @@ sourceFile:recursiveClassReferenceTest.ts > 2 > constructor(private 3 > mode: IMode -1->Emitted(70, 21) Source(79, 9) + SourceIndex(0) -2 >Emitted(70, 36) Source(79, 29) + SourceIndex(0) -3 >Emitted(70, 40) Source(79, 40) + SourceIndex(0) +1->Emitted(75, 21) Source(79, 9) + SourceIndex(0) +2 >Emitted(75, 36) Source(79, 29) + SourceIndex(0) +3 >Emitted(75, 40) Source(79, 40) + SourceIndex(0) --- >>> this.mode = mode; 1->^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1397,11 +1402,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > mode 5 > : IMode -1->Emitted(71, 25) Source(79, 29) + SourceIndex(0) -2 >Emitted(71, 34) Source(79, 33) + SourceIndex(0) -3 >Emitted(71, 37) Source(79, 29) + SourceIndex(0) -4 >Emitted(71, 41) Source(79, 33) + SourceIndex(0) -5 >Emitted(71, 42) Source(79, 40) + SourceIndex(0) +1->Emitted(76, 25) Source(79, 29) + SourceIndex(0) +2 >Emitted(76, 34) Source(79, 33) + SourceIndex(0) +3 >Emitted(76, 37) Source(79, 29) + SourceIndex(0) +4 >Emitted(76, 41) Source(79, 33) + SourceIndex(0) +5 >Emitted(76, 42) Source(79, 40) + SourceIndex(0) --- >>> } 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1409,8 +1414,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 >) { 2 > } -1 >Emitted(72, 21) Source(79, 44) + SourceIndex(0) -2 >Emitted(72, 22) Source(79, 45) + SourceIndex(0) +1 >Emitted(77, 21) Source(79, 44) + SourceIndex(0) +2 >Emitted(77, 22) Source(79, 45) + SourceIndex(0) --- >>> State.prototype.clone = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1420,9 +1425,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > clone 3 > -1->Emitted(73, 21) Source(80, 10) + SourceIndex(0) -2 >Emitted(73, 42) Source(80, 15) + SourceIndex(0) -3 >Emitted(73, 45) Source(80, 3) + SourceIndex(0) +1->Emitted(78, 21) Source(80, 10) + SourceIndex(0) +2 >Emitted(78, 42) Source(80, 15) + SourceIndex(0) +3 >Emitted(78, 45) Source(80, 3) + SourceIndex(0) --- >>> return this; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1436,11 +1441,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > this 5 > ; -1 >Emitted(74, 25) Source(81, 4) + SourceIndex(0) -2 >Emitted(74, 31) Source(81, 10) + SourceIndex(0) -3 >Emitted(74, 32) Source(81, 11) + SourceIndex(0) -4 >Emitted(74, 36) Source(81, 15) + SourceIndex(0) -5 >Emitted(74, 37) Source(81, 16) + SourceIndex(0) +1 >Emitted(79, 25) Source(81, 4) + SourceIndex(0) +2 >Emitted(79, 31) Source(81, 10) + SourceIndex(0) +3 >Emitted(79, 32) Source(81, 11) + SourceIndex(0) +4 >Emitted(79, 36) Source(81, 15) + SourceIndex(0) +5 >Emitted(79, 37) Source(81, 16) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1449,8 +1454,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(75, 21) Source(82, 3) + SourceIndex(0) -2 >Emitted(75, 22) Source(82, 4) + SourceIndex(0) +1 >Emitted(80, 21) Source(82, 3) + SourceIndex(0) +2 >Emitted(80, 22) Source(82, 4) + SourceIndex(0) --- >>> State.prototype.equals = function (other) { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1465,11 +1470,11 @@ sourceFile:recursiveClassReferenceTest.ts 3 > 4 > public equals( 5 > other:IState -1->Emitted(76, 21) Source(84, 10) + SourceIndex(0) -2 >Emitted(76, 43) Source(84, 16) + SourceIndex(0) -3 >Emitted(76, 46) Source(84, 3) + SourceIndex(0) -4 >Emitted(76, 56) Source(84, 17) + SourceIndex(0) -5 >Emitted(76, 61) Source(84, 29) + SourceIndex(0) +1->Emitted(81, 21) Source(84, 10) + SourceIndex(0) +2 >Emitted(81, 43) Source(84, 16) + SourceIndex(0) +3 >Emitted(81, 46) Source(84, 3) + SourceIndex(0) +4 >Emitted(81, 56) Source(84, 17) + SourceIndex(0) +5 >Emitted(81, 61) Source(84, 29) + SourceIndex(0) --- >>> return this === other; 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1487,13 +1492,13 @@ sourceFile:recursiveClassReferenceTest.ts 5 > === 6 > other 7 > ; -1 >Emitted(77, 25) Source(85, 4) + SourceIndex(0) -2 >Emitted(77, 31) Source(85, 10) + SourceIndex(0) -3 >Emitted(77, 32) Source(85, 11) + SourceIndex(0) -4 >Emitted(77, 36) Source(85, 15) + SourceIndex(0) -5 >Emitted(77, 41) Source(85, 20) + SourceIndex(0) -6 >Emitted(77, 46) Source(85, 25) + SourceIndex(0) -7 >Emitted(77, 47) Source(85, 26) + SourceIndex(0) +1 >Emitted(82, 25) Source(85, 4) + SourceIndex(0) +2 >Emitted(82, 31) Source(85, 10) + SourceIndex(0) +3 >Emitted(82, 32) Source(85, 11) + SourceIndex(0) +4 >Emitted(82, 36) Source(85, 15) + SourceIndex(0) +5 >Emitted(82, 41) Source(85, 20) + SourceIndex(0) +6 >Emitted(82, 46) Source(85, 25) + SourceIndex(0) +7 >Emitted(82, 47) Source(85, 26) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1502,8 +1507,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(78, 21) Source(86, 3) + SourceIndex(0) -2 >Emitted(78, 22) Source(86, 4) + SourceIndex(0) +1 >Emitted(83, 21) Source(86, 3) + SourceIndex(0) +2 >Emitted(83, 22) Source(86, 4) + SourceIndex(0) --- >>> State.prototype.getMode = function () { return mode; }; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1528,16 +1533,16 @@ sourceFile:recursiveClassReferenceTest.ts 8 > ; 9 > 10> } -1->Emitted(79, 21) Source(88, 10) + SourceIndex(0) -2 >Emitted(79, 44) Source(88, 17) + SourceIndex(0) -3 >Emitted(79, 47) Source(88, 3) + SourceIndex(0) -4 >Emitted(79, 61) Source(88, 29) + SourceIndex(0) -5 >Emitted(79, 67) Source(88, 35) + SourceIndex(0) -6 >Emitted(79, 68) Source(88, 36) + SourceIndex(0) -7 >Emitted(79, 72) Source(88, 40) + SourceIndex(0) -8 >Emitted(79, 73) Source(88, 41) + SourceIndex(0) -9 >Emitted(79, 74) Source(88, 42) + SourceIndex(0) -10>Emitted(79, 75) Source(88, 43) + SourceIndex(0) +1->Emitted(84, 21) Source(88, 10) + SourceIndex(0) +2 >Emitted(84, 44) Source(88, 17) + SourceIndex(0) +3 >Emitted(84, 47) Source(88, 3) + SourceIndex(0) +4 >Emitted(84, 61) Source(88, 29) + SourceIndex(0) +5 >Emitted(84, 67) Source(88, 35) + SourceIndex(0) +6 >Emitted(84, 68) Source(88, 36) + SourceIndex(0) +7 >Emitted(84, 72) Source(88, 40) + SourceIndex(0) +8 >Emitted(84, 73) Source(88, 41) + SourceIndex(0) +9 >Emitted(84, 74) Source(88, 42) + SourceIndex(0) +10>Emitted(84, 75) Source(88, 43) + SourceIndex(0) --- >>> return State; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1545,8 +1550,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(80, 21) Source(89, 2) + SourceIndex(0) -2 >Emitted(80, 33) Source(89, 3) + SourceIndex(0) +1 >Emitted(85, 21) Source(89, 2) + SourceIndex(0) +2 >Emitted(85, 33) Source(89, 3) + SourceIndex(0) --- >>> }()); 1 >^^^^^^^^^^^^^^^^ @@ -1569,10 +1574,10 @@ sourceFile:recursiveClassReferenceTest.ts > > public getMode(): IMode { return mode; } > } -1 >Emitted(81, 17) Source(89, 2) + SourceIndex(0) -2 >Emitted(81, 18) Source(89, 3) + SourceIndex(0) -3 >Emitted(81, 18) Source(78, 2) + SourceIndex(0) -4 >Emitted(81, 22) Source(89, 3) + SourceIndex(0) +1 >Emitted(86, 17) Source(89, 2) + SourceIndex(0) +2 >Emitted(86, 18) Source(89, 3) + SourceIndex(0) +3 >Emitted(86, 18) Source(78, 2) + SourceIndex(0) +4 >Emitted(86, 22) Source(89, 3) + SourceIndex(0) --- >>> PlainText.State = State; 1->^^^^^^^^^^^^^^^^ @@ -1595,10 +1600,10 @@ sourceFile:recursiveClassReferenceTest.ts > public getMode(): IMode { return mode; } > } 4 > -1->Emitted(82, 17) Source(78, 15) + SourceIndex(0) -2 >Emitted(82, 32) Source(78, 20) + SourceIndex(0) -3 >Emitted(82, 40) Source(89, 3) + SourceIndex(0) -4 >Emitted(82, 41) Source(89, 3) + SourceIndex(0) +1->Emitted(87, 17) Source(78, 15) + SourceIndex(0) +2 >Emitted(87, 32) Source(78, 20) + SourceIndex(0) +3 >Emitted(87, 40) Source(89, 3) + SourceIndex(0) +4 >Emitted(87, 41) Source(89, 3) + SourceIndex(0) --- >>> var Mode = (function (_super) { 1->^^^^^^^^^^^^^^^^ @@ -1606,21 +1611,21 @@ sourceFile:recursiveClassReferenceTest.ts 1-> > > -1->Emitted(83, 17) Source(91, 2) + SourceIndex(0) +1->Emitted(88, 17) Source(91, 2) + SourceIndex(0) --- >>> __extends(Mode, _super); 1->^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^ 1->export class Mode extends 2 > AbstractMode -1->Emitted(84, 21) Source(91, 28) + SourceIndex(0) -2 >Emitted(84, 45) Source(91, 40) + SourceIndex(0) +1->Emitted(89, 21) Source(91, 28) + SourceIndex(0) +2 >Emitted(89, 45) Source(91, 40) + SourceIndex(0) --- >>> function Mode() { 1 >^^^^^^^^^^^^^^^^^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(85, 21) Source(91, 2) + SourceIndex(0) +1 >Emitted(90, 21) Source(91, 2) + SourceIndex(0) --- >>> return _super.apply(this, arguments) || this; >>> } @@ -1637,8 +1642,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(87, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(87, 22) Source(99, 3) + SourceIndex(0) +1->Emitted(92, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(92, 22) Source(99, 3) + SourceIndex(0) --- >>> // scenario 2 1->^^^^^^^^^^^^^^^^^^^^ @@ -1646,8 +1651,8 @@ sourceFile:recursiveClassReferenceTest.ts 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1-> 2 > // scenario 2 -1->Emitted(88, 21) Source(93, 3) + SourceIndex(0) -2 >Emitted(88, 34) Source(93, 16) + SourceIndex(0) +1->Emitted(93, 21) Source(93, 3) + SourceIndex(0) +2 >Emitted(93, 34) Source(93, 16) + SourceIndex(0) --- >>> Mode.prototype.getInitialState = function () { 1->^^^^^^^^^^^^^^^^^^^^ @@ -1657,9 +1662,9 @@ sourceFile:recursiveClassReferenceTest.ts > public 2 > getInitialState 3 > -1->Emitted(89, 21) Source(94, 10) + SourceIndex(0) -2 >Emitted(89, 51) Source(94, 25) + SourceIndex(0) -3 >Emitted(89, 54) Source(94, 3) + SourceIndex(0) +1->Emitted(94, 21) Source(94, 10) + SourceIndex(0) +2 >Emitted(94, 51) Source(94, 25) + SourceIndex(0) +3 >Emitted(94, 54) Source(94, 3) + SourceIndex(0) --- >>> return new State(self); 1 >^^^^^^^^^^^^^^^^^^^^^^^^ @@ -1681,15 +1686,15 @@ sourceFile:recursiveClassReferenceTest.ts 7 > self 8 > ) 9 > ; -1 >Emitted(90, 25) Source(95, 4) + SourceIndex(0) -2 >Emitted(90, 31) Source(95, 10) + SourceIndex(0) -3 >Emitted(90, 32) Source(95, 11) + SourceIndex(0) -4 >Emitted(90, 36) Source(95, 15) + SourceIndex(0) -5 >Emitted(90, 41) Source(95, 20) + SourceIndex(0) -6 >Emitted(90, 42) Source(95, 21) + SourceIndex(0) -7 >Emitted(90, 46) Source(95, 25) + SourceIndex(0) -8 >Emitted(90, 47) Source(95, 26) + SourceIndex(0) -9 >Emitted(90, 48) Source(95, 27) + SourceIndex(0) +1 >Emitted(95, 25) Source(95, 4) + SourceIndex(0) +2 >Emitted(95, 31) Source(95, 10) + SourceIndex(0) +3 >Emitted(95, 32) Source(95, 11) + SourceIndex(0) +4 >Emitted(95, 36) Source(95, 15) + SourceIndex(0) +5 >Emitted(95, 41) Source(95, 20) + SourceIndex(0) +6 >Emitted(95, 42) Source(95, 21) + SourceIndex(0) +7 >Emitted(95, 46) Source(95, 25) + SourceIndex(0) +8 >Emitted(95, 47) Source(95, 26) + SourceIndex(0) +9 >Emitted(95, 48) Source(95, 27) + SourceIndex(0) --- >>> }; 1 >^^^^^^^^^^^^^^^^^^^^ @@ -1698,8 +1703,8 @@ sourceFile:recursiveClassReferenceTest.ts 1 > > 2 > } -1 >Emitted(91, 21) Source(96, 3) + SourceIndex(0) -2 >Emitted(91, 22) Source(96, 4) + SourceIndex(0) +1 >Emitted(96, 21) Source(96, 3) + SourceIndex(0) +2 >Emitted(96, 22) Source(96, 4) + SourceIndex(0) --- >>> return Mode; 1->^^^^^^^^^^^^^^^^^^^^ @@ -1710,8 +1715,8 @@ sourceFile:recursiveClassReferenceTest.ts > > 2 > } -1->Emitted(92, 21) Source(99, 2) + SourceIndex(0) -2 >Emitted(92, 32) Source(99, 3) + SourceIndex(0) +1->Emitted(97, 21) Source(99, 2) + SourceIndex(0) +2 >Emitted(97, 32) Source(99, 3) + SourceIndex(0) --- >>> }(AbstractMode)); 1->^^^^^^^^^^^^^^^^ @@ -1735,12 +1740,12 @@ sourceFile:recursiveClassReferenceTest.ts > > > } -1->Emitted(93, 17) Source(99, 2) + SourceIndex(0) -2 >Emitted(93, 18) Source(99, 3) + SourceIndex(0) -3 >Emitted(93, 18) Source(91, 2) + SourceIndex(0) -4 >Emitted(93, 19) Source(91, 28) + SourceIndex(0) -5 >Emitted(93, 31) Source(91, 40) + SourceIndex(0) -6 >Emitted(93, 34) Source(99, 3) + SourceIndex(0) +1->Emitted(98, 17) Source(99, 2) + SourceIndex(0) +2 >Emitted(98, 18) Source(99, 3) + SourceIndex(0) +3 >Emitted(98, 18) Source(91, 2) + SourceIndex(0) +4 >Emitted(98, 19) Source(91, 28) + SourceIndex(0) +5 >Emitted(98, 31) Source(91, 40) + SourceIndex(0) +6 >Emitted(98, 34) Source(99, 3) + SourceIndex(0) --- >>> PlainText.Mode = Mode; 1->^^^^^^^^^^^^^^^^ @@ -1760,10 +1765,10 @@ sourceFile:recursiveClassReferenceTest.ts > > } 4 > -1->Emitted(94, 17) Source(91, 15) + SourceIndex(0) -2 >Emitted(94, 31) Source(91, 19) + SourceIndex(0) -3 >Emitted(94, 38) Source(99, 3) + SourceIndex(0) -4 >Emitted(94, 39) Source(99, 3) + SourceIndex(0) +1->Emitted(99, 17) Source(91, 15) + SourceIndex(0) +2 >Emitted(99, 31) Source(91, 19) + SourceIndex(0) +3 >Emitted(99, 38) Source(99, 3) + SourceIndex(0) +4 >Emitted(99, 39) Source(99, 3) + SourceIndex(0) --- >>> })(PlainText = Languages.PlainText || (Languages.PlainText = {})); 1->^^^^^^^^^^^^ @@ -1809,15 +1814,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1->Emitted(95, 13) Source(100, 1) + SourceIndex(0) -2 >Emitted(95, 14) Source(100, 2) + SourceIndex(0) -3 >Emitted(95, 16) Source(76, 31) + SourceIndex(0) -4 >Emitted(95, 25) Source(76, 40) + SourceIndex(0) -5 >Emitted(95, 28) Source(76, 31) + SourceIndex(0) -6 >Emitted(95, 47) Source(76, 40) + SourceIndex(0) -7 >Emitted(95, 52) Source(76, 31) + SourceIndex(0) -8 >Emitted(95, 71) Source(76, 40) + SourceIndex(0) -9 >Emitted(95, 79) Source(100, 2) + SourceIndex(0) +1->Emitted(100, 13) Source(100, 1) + SourceIndex(0) +2 >Emitted(100, 14) Source(100, 2) + SourceIndex(0) +3 >Emitted(100, 16) Source(76, 31) + SourceIndex(0) +4 >Emitted(100, 25) Source(76, 40) + SourceIndex(0) +5 >Emitted(100, 28) Source(76, 31) + SourceIndex(0) +6 >Emitted(100, 47) Source(76, 40) + SourceIndex(0) +7 >Emitted(100, 52) Source(76, 31) + SourceIndex(0) +8 >Emitted(100, 71) Source(76, 40) + SourceIndex(0) +9 >Emitted(100, 79) Source(100, 2) + SourceIndex(0) --- >>> })(Languages = Thing.Languages || (Thing.Languages = {})); 1 >^^^^^^^^ @@ -1862,15 +1867,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(96, 9) Source(100, 1) + SourceIndex(0) -2 >Emitted(96, 10) Source(100, 2) + SourceIndex(0) -3 >Emitted(96, 12) Source(76, 21) + SourceIndex(0) -4 >Emitted(96, 21) Source(76, 30) + SourceIndex(0) -5 >Emitted(96, 24) Source(76, 21) + SourceIndex(0) -6 >Emitted(96, 39) Source(76, 30) + SourceIndex(0) -7 >Emitted(96, 44) Source(76, 21) + SourceIndex(0) -8 >Emitted(96, 59) Source(76, 30) + SourceIndex(0) -9 >Emitted(96, 67) Source(100, 2) + SourceIndex(0) +1 >Emitted(101, 9) Source(100, 1) + SourceIndex(0) +2 >Emitted(101, 10) Source(100, 2) + SourceIndex(0) +3 >Emitted(101, 12) Source(76, 21) + SourceIndex(0) +4 >Emitted(101, 21) Source(76, 30) + SourceIndex(0) +5 >Emitted(101, 24) Source(76, 21) + SourceIndex(0) +6 >Emitted(101, 39) Source(76, 30) + SourceIndex(0) +7 >Emitted(101, 44) Source(76, 21) + SourceIndex(0) +8 >Emitted(101, 59) Source(76, 30) + SourceIndex(0) +9 >Emitted(101, 67) Source(100, 2) + SourceIndex(0) --- >>> })(Thing = Sample.Thing || (Sample.Thing = {})); 1 >^^^^ @@ -1915,15 +1920,15 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(97, 5) Source(100, 1) + SourceIndex(0) -2 >Emitted(97, 6) Source(100, 2) + SourceIndex(0) -3 >Emitted(97, 8) Source(76, 15) + SourceIndex(0) -4 >Emitted(97, 13) Source(76, 20) + SourceIndex(0) -5 >Emitted(97, 16) Source(76, 15) + SourceIndex(0) -6 >Emitted(97, 28) Source(76, 20) + SourceIndex(0) -7 >Emitted(97, 33) Source(76, 15) + SourceIndex(0) -8 >Emitted(97, 45) Source(76, 20) + SourceIndex(0) -9 >Emitted(97, 53) Source(100, 2) + SourceIndex(0) +1 >Emitted(102, 5) Source(100, 1) + SourceIndex(0) +2 >Emitted(102, 6) Source(100, 2) + SourceIndex(0) +3 >Emitted(102, 8) Source(76, 15) + SourceIndex(0) +4 >Emitted(102, 13) Source(76, 20) + SourceIndex(0) +5 >Emitted(102, 16) Source(76, 15) + SourceIndex(0) +6 >Emitted(102, 28) Source(76, 20) + SourceIndex(0) +7 >Emitted(102, 33) Source(76, 15) + SourceIndex(0) +8 >Emitted(102, 45) Source(76, 20) + SourceIndex(0) +9 >Emitted(102, 53) Source(100, 2) + SourceIndex(0) --- >>>})(Sample || (Sample = {})); 1 > @@ -1965,12 +1970,12 @@ sourceFile:recursiveClassReferenceTest.ts > > } > } -1 >Emitted(98, 1) Source(100, 1) + SourceIndex(0) -2 >Emitted(98, 2) Source(100, 2) + SourceIndex(0) -3 >Emitted(98, 4) Source(76, 8) + SourceIndex(0) -4 >Emitted(98, 10) Source(76, 14) + SourceIndex(0) -5 >Emitted(98, 15) Source(76, 8) + SourceIndex(0) -6 >Emitted(98, 21) Source(76, 14) + SourceIndex(0) -7 >Emitted(98, 29) Source(100, 2) + SourceIndex(0) +1 >Emitted(103, 1) Source(100, 1) + SourceIndex(0) +2 >Emitted(103, 2) Source(100, 2) + SourceIndex(0) +3 >Emitted(103, 4) Source(76, 8) + SourceIndex(0) +4 >Emitted(103, 10) Source(76, 14) + SourceIndex(0) +5 >Emitted(103, 15) Source(76, 8) + SourceIndex(0) +6 >Emitted(103, 21) Source(76, 14) + SourceIndex(0) +7 >Emitted(103, 29) Source(100, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=recursiveClassReferenceTest.js.map \ No newline at end of file diff --git a/tests/baselines/reference/recursiveComplicatedClasses.js b/tests/baselines/reference/recursiveComplicatedClasses.js index 8441ff9e15a78..c81d10ed99beb 100644 --- a/tests/baselines/reference/recursiveComplicatedClasses.js +++ b/tests/baselines/reference/recursiveComplicatedClasses.js @@ -25,11 +25,16 @@ class TypeSymbol extends InferenceSymbol { } //// [recursiveComplicatedClasses.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Signature = (function () { function Signature() { this.parameters = null; diff --git a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js index 76224741e6033..e75661c2ea989 100644 --- a/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js +++ b/tests/baselines/reference/recursivelySpecializedConstructorDeclaration.js @@ -30,11 +30,16 @@ declare module MsPortal.Controls.Base.ItemList { */ //// [recursivelySpecializedConstructorDeclaration.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var MsPortal; (function (MsPortal) { var Controls; diff --git a/tests/baselines/reference/reexportClassDefinition.js b/tests/baselines/reference/reexportClassDefinition.js index a75a90d4d8687..5566d2968834f 100644 --- a/tests/baselines/reference/reexportClassDefinition.js +++ b/tests/baselines/reference/reexportClassDefinition.js @@ -33,11 +33,16 @@ module.exports = { }; //// [foo3.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var foo2 = require("./foo2"); var x = (function (_super) { __extends(x, _super); diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js index 94dc537298a4e..6145c8927e01d 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.js @@ -1020,11 +1020,16 @@ module caurinus { //// [resolvingClassDeclarationWhenInBaseTypeResolution.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var rionegrensis; (function (rionegrensis) { var caniventer = (function (_super) { diff --git a/tests/baselines/reference/returnInConstructor1.js b/tests/baselines/reference/returnInConstructor1.js index a47fa7ed51357..6bdcc0cb6a29d 100644 --- a/tests/baselines/reference/returnInConstructor1.js +++ b/tests/baselines/reference/returnInConstructor1.js @@ -67,11 +67,16 @@ class I extends G { //// [returnInConstructor1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { return; diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index f786e9949634e..d3ebb90435539 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -25,11 +25,16 @@ function fn13(): C { return null; } //// [returnStatements.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // all the following should be valid function fn1() { return 1; } function fn2() { return ''; } diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js index 1474f8ab29a82..81f97455a1f07 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsidePublicMethod2.js @@ -9,11 +9,16 @@ class D extends C { } //// [scopeCheckExtendedClassInsidePublicMethod2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js index 0baf01870094c..5532c363050c9 100644 --- a/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js +++ b/tests/baselines/reference/scopeCheckExtendedClassInsideStaticMethod1.js @@ -9,11 +9,16 @@ class D extends C { } //// [scopeCheckExtendedClassInsideStaticMethod1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/scopeTests.js b/tests/baselines/reference/scopeTests.js index 48863404a8ecb..b60242c07147b 100644 --- a/tests/baselines/reference/scopeTests.js +++ b/tests/baselines/reference/scopeTests.js @@ -12,11 +12,16 @@ class D extends C { } //// [scopeTests.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/shadowPrivateMembers.js b/tests/baselines/reference/shadowPrivateMembers.js index 4906814f7eb43..20be8a6028759 100644 --- a/tests/baselines/reference/shadowPrivateMembers.js +++ b/tests/baselines/reference/shadowPrivateMembers.js @@ -4,11 +4,16 @@ class derived extends base { private n() {} } //// [shadowPrivateMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var base = (function () { function base() { } diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js index 4bac0210c85ab..177c96a551a58 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js @@ -8,11 +8,16 @@ class Greeter extends AbstractGreeter { } //// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var AbstractGreeter = (function () { function AbstractGreeter() { } diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map index 6b18a783dfa1c..6de0ba822fab6 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map] -{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":[],"mappings":";;;;;AAAA;IAAA;IACA,CAAC;IAAD,sBAAC;AAAD,CAAC,AADD,IACC;AAED;IAAsB,2BAAe;IAArC;QAAA,kDAGC;QAFU,OAAC,GAAG,EAAE,CAAC;QACP,WAAK,GAAG,KAAK,CAAC;;IACzB,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,CAAsB,eAAe,GAGpC"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js","sourceRoot":"","sources":["sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts"],"names":[],"mappings":";;;;;;;;;;AAAA;IAAA;IACA,CAAC;IAAD,sBAAC;AAAD,CAAC,AADD,IACC;AAED;IAAsB,2BAAe;IAArC;QAAA,kDAGC;QAFU,OAAC,GAAG,EAAE,CAAC;QACP,WAAK,GAAG,KAAK,CAAC;;IACzB,CAAC;IAAD,cAAC;AAAD,CAAC,AAHD,CAAsB,eAAe,GAGpC"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt index 91e284fd06385..94fa02e8e6ba0 100644 --- a/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.sourcemap.txt @@ -8,22 +8,27 @@ sources: sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts emittedFile:tests/cases/compiler/sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts ------------------------------------------------------------------- ->>>var __extends = (this && this.__extends) || function (d, b) { ->>> for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; ->>> function __() { this.constructor = d; } ->>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); ->>>}; +>>>var __extends = (this && this.__extends) || (function () { +>>> var extendStatics = Object.setPrototypeOf || +>>> ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || +>>> function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; +>>> return function (d, b) { +>>> extendStatics(d, b); +>>> function __() { this.constructor = d; } +>>> d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +>>> }; +>>>})(); >>>var AbstractGreeter = (function () { 1 > 2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(6, 1) Source(1, 1) + SourceIndex(0) +1 >Emitted(11, 1) Source(1, 1) + SourceIndex(0) --- >>> function AbstractGreeter() { 1->^^^^ 2 > ^^-> 1-> -1->Emitted(7, 5) Source(1, 1) + SourceIndex(0) +1->Emitted(12, 5) Source(1, 1) + SourceIndex(0) --- >>> } 1->^^^^ @@ -32,16 +37,16 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1->class AbstractGreeter { > 2 > } -1->Emitted(8, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(8, 6) Source(2, 2) + SourceIndex(0) +1->Emitted(13, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(13, 6) Source(2, 2) + SourceIndex(0) --- >>> return AbstractGreeter; 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^ 1-> 2 > } -1->Emitted(9, 5) Source(2, 1) + SourceIndex(0) -2 >Emitted(9, 27) Source(2, 2) + SourceIndex(0) +1->Emitted(14, 5) Source(2, 1) + SourceIndex(0) +2 >Emitted(14, 27) Source(2, 2) + SourceIndex(0) --- >>>}()); 1 > @@ -54,10 +59,10 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > 4 > class AbstractGreeter { > } -1 >Emitted(10, 1) Source(2, 1) + SourceIndex(0) -2 >Emitted(10, 2) Source(2, 2) + SourceIndex(0) -3 >Emitted(10, 2) Source(1, 1) + SourceIndex(0) -4 >Emitted(10, 6) Source(2, 2) + SourceIndex(0) +1 >Emitted(15, 1) Source(2, 1) + SourceIndex(0) +2 >Emitted(15, 2) Source(2, 2) + SourceIndex(0) +3 >Emitted(15, 2) Source(1, 1) + SourceIndex(0) +4 >Emitted(15, 6) Source(2, 2) + SourceIndex(0) --- >>>var Greeter = (function (_super) { 1-> @@ -65,21 +70,21 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1-> > > -1->Emitted(11, 1) Source(4, 1) + SourceIndex(0) +1->Emitted(16, 1) Source(4, 1) + SourceIndex(0) --- >>> __extends(Greeter, _super); 1->^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1->class Greeter extends 2 > AbstractGreeter -1->Emitted(12, 5) Source(4, 23) + SourceIndex(0) -2 >Emitted(12, 32) Source(4, 38) + SourceIndex(0) +1->Emitted(17, 5) Source(4, 23) + SourceIndex(0) +2 >Emitted(17, 32) Source(4, 38) + SourceIndex(0) --- >>> function Greeter() { 1 >^^^^ 2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> 1 > -1 >Emitted(13, 5) Source(4, 1) + SourceIndex(0) +1 >Emitted(18, 5) Source(4, 1) + SourceIndex(0) --- >>> var _this = _super.apply(this, arguments) || this; 1->^^^^^^^^ @@ -89,8 +94,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -1->Emitted(14, 9) Source(4, 1) + SourceIndex(0) -2 >Emitted(14, 59) Source(7, 2) + SourceIndex(0) +1->Emitted(19, 9) Source(4, 1) + SourceIndex(0) +2 >Emitted(19, 59) Source(7, 2) + SourceIndex(0) --- >>> _this.a = 10; 1 >^^^^^^^^ @@ -104,11 +109,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > = 4 > 10 5 > ; -1 >Emitted(15, 9) Source(5, 12) + SourceIndex(0) -2 >Emitted(15, 16) Source(5, 13) + SourceIndex(0) -3 >Emitted(15, 19) Source(5, 16) + SourceIndex(0) -4 >Emitted(15, 21) Source(5, 18) + SourceIndex(0) -5 >Emitted(15, 22) Source(5, 19) + SourceIndex(0) +1 >Emitted(20, 9) Source(5, 12) + SourceIndex(0) +2 >Emitted(20, 16) Source(5, 13) + SourceIndex(0) +3 >Emitted(20, 19) Source(5, 16) + SourceIndex(0) +4 >Emitted(20, 21) Source(5, 18) + SourceIndex(0) +5 >Emitted(20, 22) Source(5, 19) + SourceIndex(0) --- >>> _this.nameA = "Ten"; 1->^^^^^^^^ @@ -122,11 +127,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > = 4 > "Ten" 5 > ; -1->Emitted(16, 9) Source(6, 12) + SourceIndex(0) -2 >Emitted(16, 20) Source(6, 17) + SourceIndex(0) -3 >Emitted(16, 23) Source(6, 20) + SourceIndex(0) -4 >Emitted(16, 28) Source(6, 25) + SourceIndex(0) -5 >Emitted(16, 29) Source(6, 26) + SourceIndex(0) +1->Emitted(21, 9) Source(6, 12) + SourceIndex(0) +2 >Emitted(21, 20) Source(6, 17) + SourceIndex(0) +3 >Emitted(21, 23) Source(6, 20) + SourceIndex(0) +4 >Emitted(21, 28) Source(6, 25) + SourceIndex(0) +5 >Emitted(21, 29) Source(6, 26) + SourceIndex(0) --- >>> return _this; >>> } @@ -136,8 +141,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 1 > > 2 > } -1 >Emitted(18, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(18, 6) Source(7, 2) + SourceIndex(0) +1 >Emitted(23, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(23, 6) Source(7, 2) + SourceIndex(0) --- >>> return Greeter; 1->^^^^ @@ -145,8 +150,8 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts 3 > ^^^-> 1-> 2 > } -1->Emitted(19, 5) Source(7, 1) + SourceIndex(0) -2 >Emitted(19, 19) Source(7, 2) + SourceIndex(0) +1->Emitted(24, 5) Source(7, 1) + SourceIndex(0) +2 >Emitted(24, 19) Source(7, 2) + SourceIndex(0) --- >>>}(AbstractGreeter)); 1-> @@ -165,11 +170,11 @@ sourceFile:sourceMapValidationClassWithDefaultConstructorAndExtendsClause.ts > public a = 10; > public nameA = "Ten"; > } -1->Emitted(20, 1) Source(7, 1) + SourceIndex(0) -2 >Emitted(20, 2) Source(7, 2) + SourceIndex(0) -3 >Emitted(20, 2) Source(4, 1) + SourceIndex(0) -4 >Emitted(20, 3) Source(4, 23) + SourceIndex(0) -5 >Emitted(20, 18) Source(4, 38) + SourceIndex(0) -6 >Emitted(20, 21) Source(7, 2) + SourceIndex(0) +1->Emitted(25, 1) Source(7, 1) + SourceIndex(0) +2 >Emitted(25, 2) Source(7, 2) + SourceIndex(0) +3 >Emitted(25, 2) Source(4, 1) + SourceIndex(0) +4 >Emitted(25, 3) Source(4, 23) + SourceIndex(0) +5 >Emitted(25, 18) Source(4, 38) + SourceIndex(0) +6 >Emitted(25, 21) Source(7, 2) + SourceIndex(0) --- >>>//# sourceMappingURL=sourceMapValidationClassWithDefaultConstructorAndExtendsClause.js.map \ No newline at end of file diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index f65f42941bfdb..1a9b07b4ca105 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -18,11 +18,16 @@ var myView = new MyView(m); // was error //// [specializedInheritedConstructors1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var View = (function () { function View(options) { } diff --git a/tests/baselines/reference/specializedOverloadWithRestParameters.js b/tests/baselines/reference/specializedOverloadWithRestParameters.js index b76afaff08c37..245fe1d40a96f 100644 --- a/tests/baselines/reference/specializedOverloadWithRestParameters.js +++ b/tests/baselines/reference/specializedOverloadWithRestParameters.js @@ -13,11 +13,16 @@ function g(tagName: any): Base { } //// [specializedOverloadWithRestParameters.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/staticFactory1.js b/tests/baselines/reference/staticFactory1.js index de7588c3ebefc..9e0d218ca509a 100644 --- a/tests/baselines/reference/staticFactory1.js +++ b/tests/baselines/reference/staticFactory1.js @@ -14,11 +14,16 @@ var d = Derived.create(); d.foo(); //// [staticFactory1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index d204c1aed47a8..6e76a0b3155e0 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -12,11 +12,16 @@ doThing(B); //OK //// [staticInheritance.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function doThing(x) { } var A = (function () { function A() { diff --git a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js index 7b8ca52b9a41f..ae6e906c6354d 100644 --- a/tests/baselines/reference/staticMemberAccessOffDerivedType1.js +++ b/tests/baselines/reference/staticMemberAccessOffDerivedType1.js @@ -10,11 +10,16 @@ class P extends SomeBase { //// [staticMemberAccessOffDerivedType1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SomeBase = (function () { function SomeBase() { } diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index 6240f8c454f49..ba54ed851c186 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -36,11 +36,16 @@ class E extends A { } //// [staticPropSuper.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index da45bda5c6efb..83ddc4bcf4e5d 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -61,11 +61,16 @@ class Ds extends A { } //// [strictModeInConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/strictModeReservedWord.js b/tests/baselines/reference/strictModeReservedWord.js index 29715745890eb..ed33097cb8378 100644 --- a/tests/baselines/reference/strictModeReservedWord.js +++ b/tests/baselines/reference/strictModeReservedWord.js @@ -28,11 +28,16 @@ function foo() { //// [strictModeReservedWord.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var let = 10; function foo() { "use strict"; diff --git a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js index 1507e53d8cf8d..d40175b6d77d7 100644 --- a/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js +++ b/tests/baselines/reference/strictModeReservedWordInClassDeclaration.js @@ -29,11 +29,16 @@ class G extends package { } class H extends package.A { } //// [strictModeReservedWordInClassDeclaration.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo(private, public, static) { private = public = static; diff --git a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js index b532df7b1201a..376574cc3dd56 100644 --- a/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js +++ b/tests/baselines/reference/stringIndexerConstrainsPropertyDeclarations2.js @@ -41,11 +41,16 @@ var b: { [x: string]: A } = { //// [stringIndexerConstrainsPropertyDeclarations2.js] // String indexer providing a constraint of a user defined type -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js index 15d6fc70da5f3..f3e5175c4a30b 100644 --- a/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js +++ b/tests/baselines/reference/subSubClassCanAccessProtectedConstructor.js @@ -17,11 +17,16 @@ class SubclassOfSubclass extends Subclass { //// [subSubClassCanAccessProtectedConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { this.instance1 = new Base(); // allowed diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index 38f5b5f1d4b3b..469288cc968f1 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -107,11 +107,16 @@ function f2(x: T, y: U) { //// [subtypesOfTypeParameter.js] // checking whether other types are subtypes of type parameters -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C3 = (function () { function C3() { } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js index 82bcbf14eccf9..90f362d9bc61c 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints.js @@ -169,11 +169,16 @@ class D29 extends C3 { //// [subtypesOfTypeParameterWithConstraints.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C3 = (function () { function C3() { } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js index e0baced37a4ea..3239afebe415b 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints4.js @@ -80,11 +80,16 @@ class D9 extends B1 { //// [subtypesOfTypeParameterWithConstraints4.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js index 0b17fc07f24d5..d55bffe2c80e3 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithRecursiveConstraints.js @@ -159,11 +159,16 @@ module M2 { //// [subtypesOfTypeParameterWithRecursiveConstraints.js] // checking whether other types are subtypes of type parameters with constraints -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function () { function Foo() { } diff --git a/tests/baselines/reference/subtypingTransitivity.js b/tests/baselines/reference/subtypingTransitivity.js index 9c4c90117589e..9292d1fb8781a 100644 --- a/tests/baselines/reference/subtypingTransitivity.js +++ b/tests/baselines/reference/subtypingTransitivity.js @@ -20,11 +20,16 @@ b.x = 1; // assigned number to string //// [subtypingTransitivity.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index 3b5fada20121b..aa919f2e737f4 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -174,11 +174,16 @@ var r18 = foo18(r18arg1); //// [subtypingWithCallSignatures2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index 4ac7d3a7f24a9..c597a841828c4 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -121,11 +121,16 @@ module WithGenericSignaturesInBaseType { //// [subtypingWithCallSignatures3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases, so function calls will all result in 'any' -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/subtypingWithCallSignatures4.js b/tests/baselines/reference/subtypingWithCallSignatures4.js index 94f549c62c18a..9b6939167efff 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures4.js +++ b/tests/baselines/reference/subtypingWithCallSignatures4.js @@ -113,11 +113,16 @@ var r18 = foo18(r18arg); //// [subtypingWithCallSignatures4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index 1d12aeb945f73..e2653d7759377 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -174,11 +174,16 @@ var r18 = foo18(r18arg1); //// [subtypingWithConstructSignatures2.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index 78582304cb8e5..820d222163854 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -123,11 +123,16 @@ module WithGenericSignaturesInBaseType { //// [subtypingWithConstructSignatures3.js] // checking subtype relations for function types as it relates to contextual signature instantiation // error cases, so function calls will all result in 'any' -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Errors; (function (Errors) { var Base = (function () { diff --git a/tests/baselines/reference/subtypingWithConstructSignatures4.js b/tests/baselines/reference/subtypingWithConstructSignatures4.js index 17252fdb809df..604604a59cf7b 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures4.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures4.js @@ -113,11 +113,16 @@ var r18 = foo18(r18arg); //// [subtypingWithConstructSignatures4.js] // checking subtype relations for function types as it relates to contextual signature instantiation -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithConstructSignatures5.js b/tests/baselines/reference/subtypingWithConstructSignatures5.js index a0561606393ca..6473bbeafd889 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures5.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures5.js @@ -51,11 +51,16 @@ interface I extends B { //// [subtypingWithConstructSignatures5.js] // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures2 just with an extra level of indirection in the inheritance chain -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithConstructSignatures6.js b/tests/baselines/reference/subtypingWithConstructSignatures6.js index c508781e089bf..dba21a9a3e282 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures6.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures6.js @@ -54,11 +54,16 @@ interface I9 extends A { // checking subtype relations for function types as it relates to contextual signature instantiation // same as subtypingWithConstructSignatures4 but using class type parameters instead of generic signatures // all are errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer.js b/tests/baselines/reference/subtypingWithNumericIndexer.js index 3cf75dd83fd78..ceae3b0f84e4a 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer.js @@ -41,11 +41,16 @@ module Generics { //// [subtypingWithNumericIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer3.js b/tests/baselines/reference/subtypingWithNumericIndexer3.js index e9e8d39bf3c28..6f77e8a5d13cb 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer3.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer3.js @@ -45,11 +45,16 @@ module Generics { //// [subtypingWithNumericIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subtypingWithNumericIndexer4.js b/tests/baselines/reference/subtypingWithNumericIndexer4.js index 798e775083fa2..c25e7abb3296c 100644 --- a/tests/baselines/reference/subtypingWithNumericIndexer4.js +++ b/tests/baselines/reference/subtypingWithNumericIndexer4.js @@ -29,11 +29,16 @@ module Generics { //// [subtypingWithNumericIndexer4.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subtypingWithObjectMembers.js b/tests/baselines/reference/subtypingWithObjectMembers.js index 3675ed6a41051..c7a2c5a938eb2 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers.js +++ b/tests/baselines/reference/subtypingWithObjectMembers.js @@ -68,11 +68,16 @@ module TwoLevels { } //// [subtypingWithObjectMembers.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithObjectMembers4.js b/tests/baselines/reference/subtypingWithObjectMembers4.js index 404b6cbe98857..4952a1e25ffa0 100644 --- a/tests/baselines/reference/subtypingWithObjectMembers4.js +++ b/tests/baselines/reference/subtypingWithObjectMembers4.js @@ -35,11 +35,16 @@ class B3 extends A3 { //// [subtypingWithObjectMembers4.js] // subtyping when property names do not match -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js index 8b168ea73b5cf..3b7b643b35e35 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility.js @@ -35,11 +35,16 @@ class B3 extends A3 { //// [subtypingWithObjectMembersAccessibility.js] // Derived member is private, base member is not causes errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js index 0a83b760218d0..40910f393f797 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersAccessibility2.js @@ -63,11 +63,16 @@ module ImplicitPublic { //// [subtypingWithObjectMembersAccessibility2.js] // Derived member is private, base member is not causes errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/subtypingWithStringIndexer.js b/tests/baselines/reference/subtypingWithStringIndexer.js index 195b7d2192e87..bfdb583ac8d82 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer.js +++ b/tests/baselines/reference/subtypingWithStringIndexer.js @@ -42,11 +42,16 @@ module Generics { //// [subtypingWithStringIndexer.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subtypingWithStringIndexer3.js b/tests/baselines/reference/subtypingWithStringIndexer3.js index 0b2a57324ebe2..3385ea5a7928f 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer3.js +++ b/tests/baselines/reference/subtypingWithStringIndexer3.js @@ -45,11 +45,16 @@ module Generics { //// [subtypingWithStringIndexer3.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/subtypingWithStringIndexer4.js b/tests/baselines/reference/subtypingWithStringIndexer4.js index 2937261ad0510..04075c906f41a 100644 --- a/tests/baselines/reference/subtypingWithStringIndexer4.js +++ b/tests/baselines/reference/subtypingWithStringIndexer4.js @@ -29,11 +29,16 @@ module Generics { //// [subtypingWithStringIndexer4.js] // Derived type indexer must be subtype of base type indexer -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/super.js b/tests/baselines/reference/super.js index 504e8542d4d9e..98c38569c37a1 100644 --- a/tests/baselines/reference/super.js +++ b/tests/baselines/reference/super.js @@ -38,11 +38,16 @@ s.foo() + ss.foo(); //// [super.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { var x; diff --git a/tests/baselines/reference/super1.js b/tests/baselines/reference/super1.js index 0094f696fafb5..7d695c2aeca0a 100644 --- a/tests/baselines/reference/super1.js +++ b/tests/baselines/reference/super1.js @@ -67,11 +67,16 @@ module Base4 { //// [super1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Case 1 var Base1 = (function () { function Base1() { diff --git a/tests/baselines/reference/super2.js b/tests/baselines/reference/super2.js index 1d2331052db1a..80bfbe0d8bec0 100644 --- a/tests/baselines/reference/super2.js +++ b/tests/baselines/reference/super2.js @@ -51,11 +51,16 @@ results1.x() + results1.y() + results2.y(); //// [super2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Case 5 var Base5 = (function () { function Base5() { diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index 0bd9d305d2eaf..a1303185739c6 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -14,11 +14,16 @@ class MyDerived extends MyBase { } //// [superAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var MyBase = (function () { function MyBase() { this.S2 = "test"; diff --git a/tests/baselines/reference/superAccess2.js b/tests/baselines/reference/superAccess2.js index fc3960fba3eab..51e8f61ab28d1 100644 --- a/tests/baselines/reference/superAccess2.js +++ b/tests/baselines/reference/superAccess2.js @@ -25,11 +25,16 @@ class Q extends P { } //// [superAccess2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var P = (function () { function P() { } diff --git a/tests/baselines/reference/superAccessInFatArrow1.js b/tests/baselines/reference/superAccessInFatArrow1.js index a7f964309f736..b4e81c65da5b3 100644 --- a/tests/baselines/reference/superAccessInFatArrow1.js +++ b/tests/baselines/reference/superAccessInFatArrow1.js @@ -16,11 +16,16 @@ module test { } //// [superAccessInFatArrow1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var test; (function (test) { var A = (function () { diff --git a/tests/baselines/reference/superCallArgsMustMatch.js b/tests/baselines/reference/superCallArgsMustMatch.js index 106d7433bf5a9..113fbd6962565 100644 --- a/tests/baselines/reference/superCallArgsMustMatch.js +++ b/tests/baselines/reference/superCallArgsMustMatch.js @@ -26,11 +26,16 @@ class T6 extends T5{ //// [superCallArgsMustMatch.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var T5 = (function () { function T5(bar) { this.bar = bar; diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index 6e30cc64052a8..ef0493d3b2b28 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -11,11 +11,16 @@ class H extends E { } //// [superCallAssignResult.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var E = (function () { function E(arg) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing1.js b/tests/baselines/reference/superCallBeforeThisAccessing1.js index e3aed9e40e9e2..3045968da16cd 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing1.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing1.js @@ -17,11 +17,16 @@ class D extends Base { //// [superCallBeforeThisAccessing1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing2.js b/tests/baselines/reference/superCallBeforeThisAccessing2.js index 91cc3d28dd6ec..d78ba6e4875ab 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing2.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing2.js @@ -11,11 +11,16 @@ class D extends Base { //// [superCallBeforeThisAccessing2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing3.js b/tests/baselines/reference/superCallBeforeThisAccessing3.js index 185767fefb6ba..99feb79042c43 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing3.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing3.js @@ -14,11 +14,16 @@ class D extends Base { //// [superCallBeforeThisAccessing3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing4.js b/tests/baselines/reference/superCallBeforeThisAccessing4.js index 91acb88ce224c..0ee568c527e46 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing4.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing4.js @@ -16,11 +16,16 @@ class E extends null { } //// [superCallBeforeThisAccessing4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { diff --git a/tests/baselines/reference/superCallBeforeThisAccessing5.js b/tests/baselines/reference/superCallBeforeThisAccessing5.js index 57228538faf37..8cd5cda05200f 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing5.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing5.js @@ -8,11 +8,16 @@ class D extends null { //// [superCallBeforeThisAccessing5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { diff --git a/tests/baselines/reference/superCallBeforeThisAccessing6.js b/tests/baselines/reference/superCallBeforeThisAccessing6.js index 4eb8e5266c2c5..244e21e6f73ff 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing6.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing6.js @@ -11,11 +11,16 @@ class D extends Base { //// [superCallBeforeThisAccessing6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing7.js b/tests/baselines/reference/superCallBeforeThisAccessing7.js index 9cfe87367741d..af649aa4c3086 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing7.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing7.js @@ -14,11 +14,16 @@ class D extends Base { //// [superCallBeforeThisAccessing7.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallBeforeThisAccessing8.js b/tests/baselines/reference/superCallBeforeThisAccessing8.js index fe459b5e03147..ae115d0ffbd26 100644 --- a/tests/baselines/reference/superCallBeforeThisAccessing8.js +++ b/tests/baselines/reference/superCallBeforeThisAccessing8.js @@ -14,11 +14,16 @@ class D extends Base { //// [superCallBeforeThisAccessing8.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(c) { } diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js index bc196299bf9c2..4ee302020ef6f 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType1.js @@ -12,11 +12,16 @@ class D extends B { //// [superCallFromClassThatDerivesFromGenericType1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js index 8a0ef085590dd..3d9c8ff717e75 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericType2.js @@ -11,11 +11,16 @@ class D extends B { //// [superCallFromClassThatDerivesFromGenericType2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js index 0529d5e3dc222..1803820712557 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js @@ -11,11 +11,16 @@ class B extends A { } //// [superCallFromClassThatDerivesFromGenericTypeButWithIncorrectNumberOfTypeArguments1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js index fb08ec289028f..77b0f4af212e7 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js @@ -11,11 +11,16 @@ class B extends A { } //// [superCallFromClassThatDerivesFromGenericTypeButWithNoTypeArguments1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js index 50153391f62a5..861bd9b470cb5 100644 --- a/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js +++ b/tests/baselines/reference/superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js @@ -11,11 +11,16 @@ class B extends A { } //// [superCallFromClassThatDerivesNonGenericTypeButWithTypeArguments1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superCallInNonStaticMethod.js b/tests/baselines/reference/superCallInNonStaticMethod.js index cd84052ca3cae..056dda2bf3392 100644 --- a/tests/baselines/reference/superCallInNonStaticMethod.js +++ b/tests/baselines/reference/superCallInNonStaticMethod.js @@ -51,11 +51,16 @@ class Other extends Doing { //// [superCallInNonStaticMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Doing = (function () { function Doing() { } diff --git a/tests/baselines/reference/superCallInStaticMethod.js b/tests/baselines/reference/superCallInStaticMethod.js index b31110fdf7896..4e2610414b7fe 100644 --- a/tests/baselines/reference/superCallInStaticMethod.js +++ b/tests/baselines/reference/superCallInStaticMethod.js @@ -47,11 +47,16 @@ class Other extends Doing { //// [superCallInStaticMethod.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Doing = (function () { function Doing() { } diff --git a/tests/baselines/reference/superCallInsideClassDeclaration.js b/tests/baselines/reference/superCallInsideClassDeclaration.js index 05e44119608aa..1533df5f305b3 100644 --- a/tests/baselines/reference/superCallInsideClassDeclaration.js +++ b/tests/baselines/reference/superCallInsideClassDeclaration.js @@ -17,11 +17,16 @@ class B extends A { } //// [superCallInsideClassDeclaration.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/superCallInsideClassExpression.js b/tests/baselines/reference/superCallInsideClassExpression.js index 3d55fe11cff49..1f3242c8b1e4f 100644 --- a/tests/baselines/reference/superCallInsideClassExpression.js +++ b/tests/baselines/reference/superCallInsideClassExpression.js @@ -17,11 +17,16 @@ class B extends A { } //// [superCallInsideClassExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js index 636b03c227f89..eb7df511e05fd 100644 --- a/tests/baselines/reference/superCallInsideObjectLiteralExpression.js +++ b/tests/baselines/reference/superCallInsideObjectLiteralExpression.js @@ -13,11 +13,16 @@ class B extends A { } //// [superCallInsideObjectLiteralExpression.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/superCallOutsideConstructor.js b/tests/baselines/reference/superCallOutsideConstructor.js index e32bfc660502b..60e9411d4142d 100644 --- a/tests/baselines/reference/superCallOutsideConstructor.js +++ b/tests/baselines/reference/superCallOutsideConstructor.js @@ -23,11 +23,16 @@ var d = new D(); //// [superCallOutsideConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superCallParameterContextualTyping1.js b/tests/baselines/reference/superCallParameterContextualTyping1.js index d8491b4ee830a..cfb0efa9d3de0 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping1.js +++ b/tests/baselines/reference/superCallParameterContextualTyping1.js @@ -13,11 +13,16 @@ class B extends A { //// [superCallParameterContextualTyping1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superCallParameterContextualTyping2.js b/tests/baselines/reference/superCallParameterContextualTyping2.js index 9868a7db1240b..f1180347142ff 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping2.js +++ b/tests/baselines/reference/superCallParameterContextualTyping2.js @@ -12,11 +12,16 @@ class C extends A { } //// [superCallParameterContextualTyping2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superCallParameterContextualTyping3.js b/tests/baselines/reference/superCallParameterContextualTyping3.js index 6a43d58c47124..c955f210779ba 100644 --- a/tests/baselines/reference/superCallParameterContextualTyping3.js +++ b/tests/baselines/reference/superCallParameterContextualTyping3.js @@ -32,11 +32,16 @@ class C extends CBase { } //// [superCallParameterContextualTyping3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var CBase = (function () { function CBase(param) { } diff --git a/tests/baselines/reference/superCallWithCommentEmit01.js b/tests/baselines/reference/superCallWithCommentEmit01.js index c7ea3cc8b855c..993776f0057a0 100644 --- a/tests/baselines/reference/superCallWithCommentEmit01.js +++ b/tests/baselines/reference/superCallWithCommentEmit01.js @@ -11,11 +11,16 @@ class B extends A { } //// [superCallWithCommentEmit01.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(text) { this.text = text; diff --git a/tests/baselines/reference/superCallWithMissingBaseClass.js b/tests/baselines/reference/superCallWithMissingBaseClass.js index 16f1108864006..a10281c4d3cfe 100644 --- a/tests/baselines/reference/superCallWithMissingBaseClass.js +++ b/tests/baselines/reference/superCallWithMissingBaseClass.js @@ -10,11 +10,16 @@ class Foo extends Bar { } //// [superCallWithMissingBaseClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Foo = (function (_super) { __extends(Foo, _super); function Foo() { diff --git a/tests/baselines/reference/superCalls.js b/tests/baselines/reference/superCalls.js index 99a3b78752c9e..e5c014a4e1618 100644 --- a/tests/baselines/reference/superCalls.js +++ b/tests/baselines/reference/superCalls.js @@ -31,11 +31,16 @@ class OtherDerived extends OtherBase { //// [superCalls.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(n) { this.x = 43; diff --git a/tests/baselines/reference/superCallsInConstructor.js b/tests/baselines/reference/superCallsInConstructor.js index 48b79acadf4dc..2290ff746cd02 100644 --- a/tests/baselines/reference/superCallsInConstructor.js +++ b/tests/baselines/reference/superCallsInConstructor.js @@ -21,11 +21,16 @@ class Derived extends Base { } //// [superCallsInConstructor.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superErrors.js b/tests/baselines/reference/superErrors.js index 19f0d74f6774a..cf7edc83a63a2 100644 --- a/tests/baselines/reference/superErrors.js +++ b/tests/baselines/reference/superErrors.js @@ -52,11 +52,16 @@ class RegisteredUser extends User { } //// [superErrors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function foo() { var _this = this; // super in a non class context diff --git a/tests/baselines/reference/superInCatchBlock1.js b/tests/baselines/reference/superInCatchBlock1.js index e1fc0f970244d..31015ee9cfc03 100644 --- a/tests/baselines/reference/superInCatchBlock1.js +++ b/tests/baselines/reference/superInCatchBlock1.js @@ -14,11 +14,16 @@ class B extends A { //// [superInCatchBlock1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/superInConstructorParam1.js b/tests/baselines/reference/superInConstructorParam1.js index d345bbc8d3a91..e860585ada7d1 100644 --- a/tests/baselines/reference/superInConstructorParam1.js +++ b/tests/baselines/reference/superInConstructorParam1.js @@ -11,11 +11,16 @@ class C extends B { } //// [superInConstructorParam1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B() { } diff --git a/tests/baselines/reference/superInLambdas.js b/tests/baselines/reference/superInLambdas.js index 73ca53c3b5cb9..83dad0b32515c 100644 --- a/tests/baselines/reference/superInLambdas.js +++ b/tests/baselines/reference/superInLambdas.js @@ -68,11 +68,16 @@ class RegisteredUser4 extends User { } //// [superInLambdas.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var User = (function () { function User() { this.name = "Bob"; diff --git a/tests/baselines/reference/superInObjectLiterals_ES5.js b/tests/baselines/reference/superInObjectLiterals_ES5.js index 5bc2b64fe36ea..7ca5cbc9e8baa 100644 --- a/tests/baselines/reference/superInObjectLiterals_ES5.js +++ b/tests/baselines/reference/superInObjectLiterals_ES5.js @@ -60,11 +60,16 @@ class B extends A { } //// [superInObjectLiterals_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; var obj = { __proto__: { diff --git a/tests/baselines/reference/superNewCall1.js b/tests/baselines/reference/superNewCall1.js index 30b07308bb25f..311f3bb6acc9a 100644 --- a/tests/baselines/reference/superNewCall1.js +++ b/tests/baselines/reference/superNewCall1.js @@ -13,11 +13,16 @@ class B extends A { } //// [superNewCall1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(map) { this.map = map; diff --git a/tests/baselines/reference/superPropertyAccess.js b/tests/baselines/reference/superPropertyAccess.js index 7b5823e598b31..0c01882e6ad3b 100644 --- a/tests/baselines/reference/superPropertyAccess.js +++ b/tests/baselines/reference/superPropertyAccess.js @@ -37,11 +37,16 @@ class MyDerived extends MyBase { } //// [superPropertyAccess.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var MyBase = (function () { function MyBase() { this.m2 = function () { }; diff --git a/tests/baselines/reference/superPropertyAccess1.js b/tests/baselines/reference/superPropertyAccess1.js index 0b1e4fc280f40..8779dd7069b36 100644 --- a/tests/baselines/reference/superPropertyAccess1.js +++ b/tests/baselines/reference/superPropertyAccess1.js @@ -28,11 +28,16 @@ class D extends C { } //// [superPropertyAccess1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superPropertyAccess2.js b/tests/baselines/reference/superPropertyAccess2.js index 7c72ad5d1bbc4..a6fb7c95b0c81 100644 --- a/tests/baselines/reference/superPropertyAccess2.js +++ b/tests/baselines/reference/superPropertyAccess2.js @@ -28,11 +28,16 @@ class D extends C { } //// [superPropertyAccess2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js index 956bce4ef2eb6..1b906baa3bb5a 100644 --- a/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js +++ b/tests/baselines/reference/superPropertyAccessInComputedPropertiesOfNestedType_ES5.js @@ -15,11 +15,16 @@ class B extends A { } //// [superPropertyAccessInComputedPropertiesOfNestedType_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/superPropertyAccessInSuperCall01.js b/tests/baselines/reference/superPropertyAccessInSuperCall01.js index de96b2bbc5e0b..d5800323de250 100644 --- a/tests/baselines/reference/superPropertyAccessInSuperCall01.js +++ b/tests/baselines/reference/superPropertyAccessInSuperCall01.js @@ -12,11 +12,16 @@ class B extends A { } //// [superPropertyAccessInSuperCall01.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A(f) { } diff --git a/tests/baselines/reference/superPropertyAccessNoError.js b/tests/baselines/reference/superPropertyAccessNoError.js index 88a5da8b8fb13..d2e3d7aad4148 100644 --- a/tests/baselines/reference/superPropertyAccessNoError.js +++ b/tests/baselines/reference/superPropertyAccessNoError.js @@ -77,11 +77,16 @@ instance.returnThis().fn(); //super.publicInstanceMemberFunction in lambda in member function //super.publicStaticMemberFunction in static member function of derived class //super.publicStaticMemberFunction in static member accessor(get and set) of derived class -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var SomeBaseClass = (function () { function SomeBaseClass() { } diff --git a/tests/baselines/reference/superPropertyAccess_ES5.js b/tests/baselines/reference/superPropertyAccess_ES5.js index 45c32076be960..6d10e60f1c063 100644 --- a/tests/baselines/reference/superPropertyAccess_ES5.js +++ b/tests/baselines/reference/superPropertyAccess_ES5.js @@ -30,11 +30,16 @@ class B extends A { } //// [superPropertyAccess_ES5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var MyBase = (function () { function MyBase() { } diff --git a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js index 2387e483c6677..2bb37a6a22cf6 100644 --- a/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js +++ b/tests/baselines/reference/superPropertyInConstructorBeforeSuperCall.js @@ -16,11 +16,16 @@ class C2 extends B { } //// [superPropertyInConstructorBeforeSuperCall.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var B = (function () { function B(x) { } diff --git a/tests/baselines/reference/superSymbolIndexedAccess5.js b/tests/baselines/reference/superSymbolIndexedAccess5.js index dd37deb5af31d..715c6568a2fc5 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess5.js +++ b/tests/baselines/reference/superSymbolIndexedAccess5.js @@ -14,11 +14,16 @@ class Bar extends Foo { } //// [superSymbolIndexedAccess5.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var symbol; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/superSymbolIndexedAccess6.js b/tests/baselines/reference/superSymbolIndexedAccess6.js index 8c8534b428ab9..c92ecda44c180 100644 --- a/tests/baselines/reference/superSymbolIndexedAccess6.js +++ b/tests/baselines/reference/superSymbolIndexedAccess6.js @@ -14,11 +14,16 @@ class Bar extends Foo { } //// [superSymbolIndexedAccess6.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var symbol; var Foo = (function () { function Foo() { diff --git a/tests/baselines/reference/superWithGenericSpecialization.js b/tests/baselines/reference/superWithGenericSpecialization.js index a0381d0b944d8..6f3cee935ef57 100644 --- a/tests/baselines/reference/superWithGenericSpecialization.js +++ b/tests/baselines/reference/superWithGenericSpecialization.js @@ -15,11 +15,16 @@ var r: string = d.x; var r2: number = d.y; //// [superWithGenericSpecialization.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superWithGenerics.js b/tests/baselines/reference/superWithGenerics.js index 803f229bd4bd4..a66656832f43f 100644 --- a/tests/baselines/reference/superWithGenerics.js +++ b/tests/baselines/reference/superWithGenerics.js @@ -12,11 +12,16 @@ class D extends B { //// [superWithGenerics.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var D = (function (_super) { __extends(D, _super); function D() { diff --git a/tests/baselines/reference/superWithTypeArgument.js b/tests/baselines/reference/superWithTypeArgument.js index a1c0497540442..158799cc93d8c 100644 --- a/tests/baselines/reference/superWithTypeArgument.js +++ b/tests/baselines/reference/superWithTypeArgument.js @@ -10,11 +10,16 @@ class D extends C { } //// [superWithTypeArgument.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superWithTypeArgument2.js b/tests/baselines/reference/superWithTypeArgument2.js index 42a0e46d4c03e..349589625fbd3 100644 --- a/tests/baselines/reference/superWithTypeArgument2.js +++ b/tests/baselines/reference/superWithTypeArgument2.js @@ -10,11 +10,16 @@ class D extends C { } //// [superWithTypeArgument2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/superWithTypeArgument3.js b/tests/baselines/reference/superWithTypeArgument3.js index 803e5c264c22a..a8325a5a5945a 100644 --- a/tests/baselines/reference/superWithTypeArgument3.js +++ b/tests/baselines/reference/superWithTypeArgument3.js @@ -14,11 +14,16 @@ class D extends C { } //// [superWithTypeArgument3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js index d6f8e36c526de..e5c8546d0a11c 100644 --- a/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js +++ b/tests/baselines/reference/super_inside-object-literal-getters-and-setters.js @@ -28,11 +28,16 @@ class SuperObjectTest extends F { //// [super_inside-object-literal-getters-and-setters.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ObjectLiteral; (function (ObjectLiteral) { var ThisInObjectLiteral = { diff --git a/tests/baselines/reference/switchStatements.js b/tests/baselines/reference/switchStatements.js index 2e1aecc728830..7d8c2477b68b7 100644 --- a/tests/baselines/reference/switchStatements.js +++ b/tests/baselines/reference/switchStatements.js @@ -56,11 +56,16 @@ switch (((x: T) => '')(1)) { } //// [switchStatements.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { function fn(x) { diff --git a/tests/baselines/reference/systemModuleWithSuperClass.js b/tests/baselines/reference/systemModuleWithSuperClass.js index 78c09355fa006..76c4648daa10e 100644 --- a/tests/baselines/reference/systemModuleWithSuperClass.js +++ b/tests/baselines/reference/systemModuleWithSuperClass.js @@ -32,11 +32,16 @@ System.register([], function (exports_1, context_1) { //// [bar.js] System.register(["./foo"], function (exports_1, context_1) { "use strict"; - var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; + var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; + })(); var __moduleName = context_1 && context_1.id; var foo_1, Bar; return { diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index cac93023a00e0..70e14fd521f68 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -19,11 +19,16 @@ class Bar extends Foo { constructor() { super(function(s) { s = 5 }) } } // err //// [targetTypeBaseCalls.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function foo(x) { } var Foo = (function () { function Foo(x) { diff --git a/tests/baselines/reference/thisInInvalidContexts.js b/tests/baselines/reference/thisInInvalidContexts.js index 7f299fd7e10fd..f438e039ba437 100644 --- a/tests/baselines/reference/thisInInvalidContexts.js +++ b/tests/baselines/reference/thisInInvalidContexts.js @@ -49,11 +49,16 @@ enum SomeEnum { //// [thisInInvalidContexts.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //'this' in static member initializer var ErrClass1 = (function () { function ErrClass1() { diff --git a/tests/baselines/reference/thisInInvalidContextsExternalModule.js b/tests/baselines/reference/thisInInvalidContextsExternalModule.js index 65a1ef1eee9a8..63056e497c4c3 100644 --- a/tests/baselines/reference/thisInInvalidContextsExternalModule.js +++ b/tests/baselines/reference/thisInInvalidContextsExternalModule.js @@ -50,11 +50,16 @@ export = this; // Should be an error //// [thisInInvalidContextsExternalModule.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); //'this' in static member initializer var ErrClass1 = (function () { function ErrClass1() { diff --git a/tests/baselines/reference/thisInSuperCall.js b/tests/baselines/reference/thisInSuperCall.js index 1c1f11ffbc88f..e28588b2142bb 100644 --- a/tests/baselines/reference/thisInSuperCall.js +++ b/tests/baselines/reference/thisInSuperCall.js @@ -23,11 +23,16 @@ class Foo3 extends Base { } //// [thisInSuperCall.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(x) { } diff --git a/tests/baselines/reference/thisInSuperCall1.js b/tests/baselines/reference/thisInSuperCall1.js index e3eea1fb91de2..c975c10927e9e 100644 --- a/tests/baselines/reference/thisInSuperCall1.js +++ b/tests/baselines/reference/thisInSuperCall1.js @@ -11,11 +11,16 @@ class Foo extends Base { //// [thisInSuperCall1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(a) { } diff --git a/tests/baselines/reference/thisInSuperCall2.js b/tests/baselines/reference/thisInSuperCall2.js index 6288082ed64f0..7112f7b21d15e 100644 --- a/tests/baselines/reference/thisInSuperCall2.js +++ b/tests/baselines/reference/thisInSuperCall2.js @@ -20,11 +20,16 @@ class Foo2 extends Base { //// [thisInSuperCall2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(a) { } diff --git a/tests/baselines/reference/thisInSuperCall3.js b/tests/baselines/reference/thisInSuperCall3.js index 6a72f17248f4b..2e07d2948433a 100644 --- a/tests/baselines/reference/thisInSuperCall3.js +++ b/tests/baselines/reference/thisInSuperCall3.js @@ -13,11 +13,16 @@ class Foo extends Base { //// [thisInSuperCall3.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(a) { } diff --git a/tests/baselines/reference/thisTypeInFunctions.js b/tests/baselines/reference/thisTypeInFunctions.js index 6400f410a0926..8a09f18b3f18f 100644 --- a/tests/baselines/reference/thisTypeInFunctions.js +++ b/tests/baselines/reference/thisTypeInFunctions.js @@ -195,11 +195,16 @@ function missingTypeIsImplicitAny(this, a: number) { return this.anything + a; } //// [thisTypeInFunctions.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; // body checking var B = (function () { diff --git a/tests/baselines/reference/thisTypeInFunctionsNegative.js b/tests/baselines/reference/thisTypeInFunctionsNegative.js index 446bc15e6d9da..c68aa2ee0a026 100644 --- a/tests/baselines/reference/thisTypeInFunctionsNegative.js +++ b/tests/baselines/reference/thisTypeInFunctionsNegative.js @@ -177,11 +177,16 @@ c.explicitProperty = (this, m) => m + this.n; //// [thisTypeInFunctionsNegative.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var _this = this; var C = (function () { function C() { diff --git a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js index f5d35ccaf7718..b092b4c96d514 100644 --- a/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js +++ b/tests/baselines/reference/tsxCorrectlyParseLessThanComparison1.js @@ -21,11 +21,16 @@ export class ShortDetails extends React.Component<{ id: number }, {}> { //// [tsxCorrectlyParseLessThanComparison1.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ShortDetails = (function (_super) { __extends(ShortDetails, _super); function ShortDetails() { diff --git a/tests/baselines/reference/tsxDynamicTagName5.js b/tests/baselines/reference/tsxDynamicTagName5.js index d3bb404ceea6c..d40e84c907850 100644 --- a/tests/baselines/reference/tsxDynamicTagName5.js +++ b/tests/baselines/reference/tsxDynamicTagName5.js @@ -21,11 +21,16 @@ export class Text extends React.Component<{}, {}> { //// [app.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var Text = (function (_super) { __extends(Text, _super); diff --git a/tests/baselines/reference/tsxDynamicTagName7.js b/tests/baselines/reference/tsxDynamicTagName7.js index 84debfd3e7194..8e051ec9012d5 100644 --- a/tests/baselines/reference/tsxDynamicTagName7.js +++ b/tests/baselines/reference/tsxDynamicTagName7.js @@ -21,11 +21,16 @@ export class Text extends React.Component<{}, {}> { //// [app.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var Text = (function (_super) { __extends(Text, _super); diff --git a/tests/baselines/reference/tsxDynamicTagName8.js b/tests/baselines/reference/tsxDynamicTagName8.js index 6166b99f4accb..6f24711305569 100644 --- a/tests/baselines/reference/tsxDynamicTagName8.js +++ b/tests/baselines/reference/tsxDynamicTagName8.js @@ -21,11 +21,16 @@ export class Text extends React.Component<{}, {}> { //// [app.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var Text = (function (_super) { __extends(Text, _super); diff --git a/tests/baselines/reference/tsxDynamicTagName9.js b/tests/baselines/reference/tsxDynamicTagName9.js index 928649264c8b6..652d633421638 100644 --- a/tests/baselines/reference/tsxDynamicTagName9.js +++ b/tests/baselines/reference/tsxDynamicTagName9.js @@ -21,11 +21,16 @@ export class Text extends React.Component<{}, {}> { //// [app.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var Text = (function (_super) { __extends(Text, _super); diff --git a/tests/baselines/reference/tsxExternalModuleEmit1.js b/tests/baselines/reference/tsxExternalModuleEmit1.js index 58e7f1c8d856e..b030df4f253ba 100644 --- a/tests/baselines/reference/tsxExternalModuleEmit1.js +++ b/tests/baselines/reference/tsxExternalModuleEmit1.js @@ -33,11 +33,16 @@ export class Button extends React.Component { //// [button.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var Button = (function (_super) { __extends(Button, _super); @@ -52,11 +57,16 @@ var Button = (function (_super) { exports.Button = Button; //// [app.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); // Should see var button_1 = require('./button') here var button_1 = require("./button"); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.js b/tests/baselines/reference/tsxStatelessFunctionComponents2.js index 88d917235012b..e0165faa36a04 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.js +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.js @@ -40,11 +40,16 @@ let i =
x.propertyNotOnHtmlDivElement} />; //// [file.jsx] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); function Greet(x) { return
Hello, {x}
; diff --git a/tests/baselines/reference/tsxUnionTypeComponent1.js b/tests/baselines/reference/tsxUnionTypeComponent1.js index 3520b5af3720a..601be253e50ec 100644 --- a/tests/baselines/reference/tsxUnionTypeComponent1.js +++ b/tests/baselines/reference/tsxUnionTypeComponent1.js @@ -26,11 +26,16 @@ class MyButtonComponent extends React.Component<{},{}> { //// [file.js] "use strict"; -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var React = require("react"); var MyComponent = (function (_super) { __extends(MyComponent, _super); diff --git a/tests/baselines/reference/typeAssertions.js b/tests/baselines/reference/typeAssertions.js index a57fb222a77c0..84101c7db2d40 100644 --- a/tests/baselines/reference/typeAssertions.js +++ b/tests/baselines/reference/typeAssertions.js @@ -52,11 +52,16 @@ if((numOrStr === undefined) as numOrStr is string) { // Error //// [typeAssertions.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Function call whose argument is a 1 arg generic function call with explicit type arguments function fn1(t) { } function fn2(t) { } diff --git a/tests/baselines/reference/typeGuardFunction.js b/tests/baselines/reference/typeGuardFunction.js index b88d1038969d2..8ce969eaa80c2 100644 --- a/tests/baselines/reference/typeGuardFunction.js +++ b/tests/baselines/reference/typeGuardFunction.js @@ -84,11 +84,16 @@ let union2: C | B; let union3: boolean | B = isA(union2) || union2; //// [typeGuardFunction.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/typeGuardFunctionErrors.js b/tests/baselines/reference/typeGuardFunctionErrors.js index 99c25faaa88ca..1471a235b899f 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.js +++ b/tests/baselines/reference/typeGuardFunctionErrors.js @@ -146,11 +146,16 @@ if (hasMissingParameter()) { } //// [typeGuardFunctionErrors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/typeGuardFunctionGenerics.js b/tests/baselines/reference/typeGuardFunctionGenerics.js index 703c809274fc7..9fec88b19597f 100644 --- a/tests/baselines/reference/typeGuardFunctionGenerics.js +++ b/tests/baselines/reference/typeGuardFunctionGenerics.js @@ -34,11 +34,16 @@ if (funD(isC, a)) { let test3: B = funE(isB, 1); //// [typeGuardFunctionGenerics.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var A = (function () { function A() { } diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThis.js b/tests/baselines/reference/typeGuardFunctionOfFormThis.js index c052ea7d72b3c..58b9c9027fa9d 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThis.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThis.js @@ -142,11 +142,16 @@ interface MimicGuardInterface { //// [typeGuardFunctionOfFormThis.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var RoyalGuard = (function () { function RoyalGuard() { } diff --git a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js index a85a207a665f7..b53f3ca511acb 100644 --- a/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js +++ b/tests/baselines/reference/typeGuardFunctionOfFormThisErrors.js @@ -60,11 +60,16 @@ else { } //// [typeGuardFunctionOfFormThisErrors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var RoyalGuard = (function () { function RoyalGuard() { } diff --git a/tests/baselines/reference/typeGuardOfFormInstanceOf.js b/tests/baselines/reference/typeGuardOfFormInstanceOf.js index a181a446a81e2..23a1770d56444 100644 --- a/tests/baselines/reference/typeGuardOfFormInstanceOf.js +++ b/tests/baselines/reference/typeGuardOfFormInstanceOf.js @@ -73,11 +73,16 @@ else { // - when true, narrows the type of x to the type of the 'prototype' property in C provided // it is a subtype of the type of x, or // - when false, has no effect on the type of x. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/typeGuardOfFormIsType.js b/tests/baselines/reference/typeGuardOfFormIsType.js index 14e9259a9e781..3ea3839651eb2 100644 --- a/tests/baselines/reference/typeGuardOfFormIsType.js +++ b/tests/baselines/reference/typeGuardOfFormIsType.js @@ -38,11 +38,16 @@ str = isD1(c2Ord1) && c2Ord1.p1; // D1 var r2: C2 | D1 = isC1(c2Ord1) && c2Ord1; // C2 | D1 //// [typeGuardOfFormIsType.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C1 = (function () { function C1() { } diff --git a/tests/baselines/reference/typeGuardOfFormThisMember.js b/tests/baselines/reference/typeGuardOfFormThisMember.js index 52097af34f782..6540c298766ba 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMember.js +++ b/tests/baselines/reference/typeGuardOfFormThisMember.js @@ -83,11 +83,16 @@ namespace Test { //// [typeGuardOfFormThisMember.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // There's a 'File' class in the stdlib, wrap with a namespace to avoid collision var Test; (function (Test) { diff --git a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js index c65445a3a5a80..9e4fd71e1ec08 100644 --- a/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js +++ b/tests/baselines/reference/typeGuardOfFormThisMemberErrors.js @@ -33,11 +33,16 @@ namespace Test { } //// [typeGuardOfFormThisMemberErrors.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // There's a 'File' class in the stdlib, wrap with a namespace to avoid collision var Test; (function (Test) { diff --git a/tests/baselines/reference/typeMatch2.js b/tests/baselines/reference/typeMatch2.js index 2cae93924bc55..b051cdf506f9a 100644 --- a/tests/baselines/reference/typeMatch2.js +++ b/tests/baselines/reference/typeMatch2.js @@ -45,11 +45,16 @@ function f4() { //// [typeMatch2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function f1() { var a = { x: 1, y: 2 }; a = {}; // error diff --git a/tests/baselines/reference/typeOfSuperCall.js b/tests/baselines/reference/typeOfSuperCall.js index 179e981b8d1dc..48f57c4c9f7d5 100644 --- a/tests/baselines/reference/typeOfSuperCall.js +++ b/tests/baselines/reference/typeOfSuperCall.js @@ -9,11 +9,16 @@ class D extends C { } //// [typeOfSuperCall.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { } diff --git a/tests/baselines/reference/typeParameterAsBaseClass.js b/tests/baselines/reference/typeParameterAsBaseClass.js index 15d1c3b396e3f..444e44c368731 100644 --- a/tests/baselines/reference/typeParameterAsBaseClass.js +++ b/tests/baselines/reference/typeParameterAsBaseClass.js @@ -3,11 +3,16 @@ class C extends T {} class C2 implements T {} //// [typeParameterAsBaseClass.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/typeParameterAsBaseType.js b/tests/baselines/reference/typeParameterAsBaseType.js index 2d0962f01d77d..00d8781efcaa6 100644 --- a/tests/baselines/reference/typeParameterAsBaseType.js +++ b/tests/baselines/reference/typeParameterAsBaseType.js @@ -13,11 +13,16 @@ interface I2 extends U { } //// [typeParameterAsBaseType.js] // type parameters cannot be used as base types // these are all errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function (_super) { __extends(C, _super); function C() { diff --git a/tests/baselines/reference/typeParameterExtendingUnion1.js b/tests/baselines/reference/typeParameterExtendingUnion1.js index 2738aa205281e..7b456983f2e65 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion1.js +++ b/tests/baselines/reference/typeParameterExtendingUnion1.js @@ -13,11 +13,16 @@ function f(a: T) { } //// [typeParameterExtendingUnion1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Animal = (function () { function Animal() { } diff --git a/tests/baselines/reference/typeParameterExtendingUnion2.js b/tests/baselines/reference/typeParameterExtendingUnion2.js index b3754436f2684..508eb8e0616be 100644 --- a/tests/baselines/reference/typeParameterExtendingUnion2.js +++ b/tests/baselines/reference/typeParameterExtendingUnion2.js @@ -13,11 +13,16 @@ function f(a: T) { } //// [typeParameterExtendingUnion2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Animal = (function () { function Animal() { } diff --git a/tests/baselines/reference/typeRelationships.js b/tests/baselines/reference/typeRelationships.js index 2f97f4b0d1c07..93d920a6c8cb4 100644 --- a/tests/baselines/reference/typeRelationships.js +++ b/tests/baselines/reference/typeRelationships.js @@ -41,11 +41,16 @@ class D extends C { //// [typeRelationships.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C() { this.self = this; diff --git a/tests/baselines/reference/typeValueConflict1.js b/tests/baselines/reference/typeValueConflict1.js index 8711a656bf5f9..065c2968a12ef 100644 --- a/tests/baselines/reference/typeValueConflict1.js +++ b/tests/baselines/reference/typeValueConflict1.js @@ -12,11 +12,16 @@ module M2 { //// [typeValueConflict1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M1; (function (M1) { var A = (function () { diff --git a/tests/baselines/reference/typeValueConflict2.js b/tests/baselines/reference/typeValueConflict2.js index 7abda8110b6c6..6cbcc708a0d9e 100644 --- a/tests/baselines/reference/typeValueConflict2.js +++ b/tests/baselines/reference/typeValueConflict2.js @@ -19,11 +19,16 @@ module M3 { //// [typeValueConflict2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M1; (function (M1) { var A = (function () { diff --git a/tests/baselines/reference/typeofClass2.js b/tests/baselines/reference/typeofClass2.js index f1ec6a77b14d3..e829411ed320e 100644 --- a/tests/baselines/reference/typeofClass2.js +++ b/tests/baselines/reference/typeofClass2.js @@ -22,11 +22,16 @@ var r1: typeof D; var r2: typeof d; //// [typeofClass2.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var C = (function () { function C(x) { } diff --git a/tests/baselines/reference/typesWithSpecializedCallSignatures.js b/tests/baselines/reference/typesWithSpecializedCallSignatures.js index 045f7b40e555c..282a3f72f1554 100644 --- a/tests/baselines/reference/typesWithSpecializedCallSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedCallSignatures.js @@ -43,11 +43,16 @@ var r3: Base = c.foo('hm'); //// [typesWithSpecializedCallSignatures.js] // basic uses of specialized signatures without errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js index b4d42d819edb6..b27eaf2725c7f 100644 --- a/tests/baselines/reference/typesWithSpecializedConstructSignatures.js +++ b/tests/baselines/reference/typesWithSpecializedConstructSignatures.js @@ -41,11 +41,16 @@ var r3: Base = new a('hm'); //// [typesWithSpecializedConstructSignatures.js] // basic uses of specialized signatures without errors -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/undeclaredBase.js b/tests/baselines/reference/undeclaredBase.js index 4b7813231cf86..ed2f2d66d93da 100644 --- a/tests/baselines/reference/undeclaredBase.js +++ b/tests/baselines/reference/undeclaredBase.js @@ -4,11 +4,16 @@ module M { export class C extends M.I { } } //// [undeclaredBase.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var M; (function (M) { var C = (function (_super) { diff --git a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js index 7e480d18a0aa1..c00281f2b8c82 100644 --- a/tests/baselines/reference/undefinedIsSubtypeOfEverything.js +++ b/tests/baselines/reference/undefinedIsSubtypeOfEverything.js @@ -123,11 +123,16 @@ class D17 extends Base { //// [undefinedIsSubtypeOfEverything.js] // undefined is a subtype of every other types, no errors expected below -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base() { } diff --git a/tests/baselines/reference/underscoreMapFirst.js b/tests/baselines/reference/underscoreMapFirst.js index c8e936af5277f..c0b6cf1b6dad8 100644 --- a/tests/baselines/reference/underscoreMapFirst.js +++ b/tests/baselines/reference/underscoreMapFirst.js @@ -49,11 +49,16 @@ class MyView extends View { //// [underscoreMapFirst.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var MyView = (function (_super) { __extends(MyView, _super); function MyView() { diff --git a/tests/baselines/reference/underscoreThisInDerivedClass01.js b/tests/baselines/reference/underscoreThisInDerivedClass01.js index 000176c213f48..410503dc6fcfc 100644 --- a/tests/baselines/reference/underscoreThisInDerivedClass01.js +++ b/tests/baselines/reference/underscoreThisInDerivedClass01.js @@ -25,11 +25,16 @@ class D extends C { //// [underscoreThisInDerivedClass01.js] // @target es5 -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Original test intent: // When arrow functions capture 'this', the lexical 'this' owner // currently captures 'this' using a variable named '_this'. diff --git a/tests/baselines/reference/underscoreThisInDerivedClass02.js b/tests/baselines/reference/underscoreThisInDerivedClass02.js index c1e9494376b53..365ba64a2c644 100644 --- a/tests/baselines/reference/underscoreThisInDerivedClass02.js +++ b/tests/baselines/reference/underscoreThisInDerivedClass02.js @@ -19,11 +19,16 @@ class D extends C { //// [underscoreThisInDerivedClass02.js] // @target es5 -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // Original test intent: // Errors on '_this' should be reported in derived constructors, // even if 'super()' is not called. diff --git a/tests/baselines/reference/unionTypeEquivalence.js b/tests/baselines/reference/unionTypeEquivalence.js index e4d0acc893cc0..a11476152f9ba 100644 --- a/tests/baselines/reference/unionTypeEquivalence.js +++ b/tests/baselines/reference/unionTypeEquivalence.js @@ -20,11 +20,16 @@ var z1: string | typeof BC; //// [unionTypeEquivalence.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // A | B is equivalent to A if B is a subtype of A var C = (function () { function C() { diff --git a/tests/baselines/reference/unionTypeFromArrayLiteral.js b/tests/baselines/reference/unionTypeFromArrayLiteral.js index 83ad2a343946b..9b42b1b7532f1 100644 --- a/tests/baselines/reference/unionTypeFromArrayLiteral.js +++ b/tests/baselines/reference/unionTypeFromArrayLiteral.js @@ -28,11 +28,16 @@ var arr9 = [e, f]; // (E|F)[] // If the array literal is empty, the resulting type is an array type with the element type Undefined. // Otherwise, if the array literal is contextually typed by a type that has a property with the numeric name ‘0’, the resulting type is a tuple type constructed from the types of the element expressions. // Otherwise, the resulting type is an array type with an element type that is the union of the types of the element expressions. -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var arr1 = [1, 2]; // number[] var arr2 = ["hello", true]; // (string | number)[] var arr3Tuple = [3, "three"]; // [number, string] diff --git a/tests/baselines/reference/unionTypesAssignability.js b/tests/baselines/reference/unionTypesAssignability.js index 231b8b27f3ba6..87be4dbb4fd69 100644 --- a/tests/baselines/reference/unionTypesAssignability.js +++ b/tests/baselines/reference/unionTypesAssignability.js @@ -74,11 +74,16 @@ function foo(t: T, u: U) { //// [unionTypesAssignability.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var unionNumberString; var C = (function () { function C() { diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 832868c4b8ff8..7ec636f672a93 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -33,11 +33,16 @@ class C5 { } //// [unknownSymbols1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var x = asdf; var y; function foo(x, y) { } diff --git a/tests/baselines/reference/unspecializedConstraints.js b/tests/baselines/reference/unspecializedConstraints.js index 1343bea602e39..53b4fcf2f22ba 100644 --- a/tests/baselines/reference/unspecializedConstraints.js +++ b/tests/baselines/reference/unspecializedConstraints.js @@ -154,11 +154,16 @@ module ts { //// [unspecializedConstraints.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var ts; (function (ts) { var Symbol = (function () { diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index b82a7cbc0ae9e..2adb8dae89f18 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -44,11 +44,16 @@ c5(1); // error //// [untypedFunctionCallsWithTypeParameters1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); // none of these function calls should be allowed var x = function () { return; }; var r1 = x(); diff --git a/tests/baselines/reference/unusedClassesinNamespace4.js b/tests/baselines/reference/unusedClassesinNamespace4.js index 0ab1227bf3d04..85c5cc6aae7eb 100644 --- a/tests/baselines/reference/unusedClassesinNamespace4.js +++ b/tests/baselines/reference/unusedClassesinNamespace4.js @@ -15,11 +15,16 @@ namespace Validation { } //// [unusedClassesinNamespace4.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Validation; (function (Validation) { var c1 = (function () { diff --git a/tests/baselines/reference/unusedIdentifiersConsolidated1.js b/tests/baselines/reference/unusedIdentifiersConsolidated1.js index dbb261e5f2a03..6615c45cf294c 100644 --- a/tests/baselines/reference/unusedIdentifiersConsolidated1.js +++ b/tests/baselines/reference/unusedIdentifiersConsolidated1.js @@ -103,11 +103,16 @@ namespace Greeter { } //// [unusedIdentifiersConsolidated1.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); function greeter(person) { var unused = 20; } diff --git a/tests/baselines/reference/validUseOfThisInSuper.js b/tests/baselines/reference/validUseOfThisInSuper.js index bbd564db3663b..d3f574c3cef16 100644 --- a/tests/baselines/reference/validUseOfThisInSuper.js +++ b/tests/baselines/reference/validUseOfThisInSuper.js @@ -10,11 +10,16 @@ class Super extends Base { } //// [validUseOfThisInSuper.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); var Base = (function () { function Base(b) { this.b = b; diff --git a/tests/baselines/reference/varArgsOnConstructorTypes.js b/tests/baselines/reference/varArgsOnConstructorTypes.js index 0875f2ba1dd85..c859b4f8260d8 100644 --- a/tests/baselines/reference/varArgsOnConstructorTypes.js +++ b/tests/baselines/reference/varArgsOnConstructorTypes.js @@ -25,11 +25,16 @@ reg.register(B); //// [varArgsOnConstructorTypes.js] -var __extends = (this && this.__extends) || function (d, b) { - for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -}; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); define(["require", "exports"], function (require, exports) { "use strict"; var A = (function () {