Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
vvakame committed Nov 25, 2016
1 parent 1ba7b3d commit f968f1b
Show file tree
Hide file tree
Showing 666 changed files with 4,006 additions and 1,326 deletions.
6 changes: 5 additions & 1 deletion src/compiler/transformers/es2015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,11 @@ namespace ts {
priority: 0,
text: `
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ module A {

//// [ExportClassWithAccessibleTypesInTypeParameterConstraintsClassHeritageListMemberTypeAnnotations.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ module A {

//// [ExportClassWithInaccessibleTypeInTypeParameterConstraint.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/abstractClassInLocalScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

//// [abstractClassInLocalScope.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

//// [abstractClassInLocalScopeIsAbstract.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/abstractProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ class C extends B {

//// [abstractProperty.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/abstractPropertyNegative.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ abstract class AbstractAccessorMismatch {

//// [abstractPropertyNegative.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class ColoredPoint extends Point {

//// [accessOverriddenBaseClassMember1.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class LanguageSpec_section_4_5_inference {

//// [accessors_spec_section-4.5_inference.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInAccessorsOfClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ exports.Model = Model;
//// [aliasUsage1_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ exports.Model = Model;
//// [aliasUsageInArray_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInFunctionExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ exports.Model = Model;
//// [aliasUsageInFunctionExpression_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInGenericFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ exports.Model = Model;
//// [aliasUsageInGenericFunction_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInIndexerOfClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ exports.Model = Model;
//// [aliasUsageInIndexerOfClass_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInObjectLiteral.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ exports.Model = Model;
//// [aliasUsageInObjectLiteral_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInOrExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ exports.Model = Model;
//// [aliasUsageInOrExpression_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ exports.Model = Model;
//// [aliasUsageInTypeArgumentOfExtendsClause_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand All @@ -51,7 +55,11 @@ exports.VisualizationModel = VisualizationModel;
//// [aliasUsageInTypeArgumentOfExtendsClause_main.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/aliasUsageInVarAssignment.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ exports.Model = Model;
//// [aliasUsageInVarAssignment_moduleA.js]
"use strict";
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/ambiguousOverloadResolution.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ var t: number = f(x, x); // Not an error

//// [ambiguousOverloadResolution.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/apparentTypeSubtyping.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ class Derived2<U extends String> extends Base2 { // error because of the prototy
// 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) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/apparentTypeSupertype.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ class Derived<U extends String> extends Base { // error
// 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) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrayAssignmentTest1.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ arr_any = i1; // should be an error - is

//// [arrayAssignmentTest1.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrayAssignmentTest2.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ arr_any = i1; // should be an error - is

//// [arrayAssignmentTest2.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrayBestCommonTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ module NonEmptyTypes {

//// [arrayBestCommonTypes.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrayLiteralTypeInference.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ var z3: { id: number }[] =

//// [arrayLiteralTypeInference.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrayLiterals.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ 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) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ var as = [list, myDerivedList]; // List<number>[]

//// [arrayLiteralsWithRecursiveGenerics.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ rrb = cra; // error: 'A' is not assignable to 'B'

//// [arrayOfSubtypeIsAssignableToReadonlyArray.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down
6 changes: 5 additions & 1 deletion tests/baselines/reference/arrowFunctionContexts.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ var asserted2: any;

//// [arrowFunctionContexts.js]
var __extends = (this && this.__extends) || function (d, b) {
Object.setPrototypeOf(d, b);
if (typeof Object.setPrototypeOf === "function") {
Object.setPrototypeOf(d, b);
} else {
d.__proto__ = b;
}
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
Expand Down

0 comments on commit f968f1b

Please sign in to comment.