10000 Remove transformCompatibleEmit flag and make it the default. · icssjs/TypeScript@b1d8828 · GitHub
[go: up one dir, main page]

Skip to content

Commit b1d8828

Browse files
committed
Remove transformCompatibleEmit flag and make it the default.
1 parent cd2cf7d commit b1d8828

File tree

171 files changed

+961
-1031
lines changed

Some content is hidden

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

171 files changed

+961
-1031
lines changed

Jakefile.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ function concatenateFiles(destinationFile, sourceFiles) {
223223

224224
var useDebugMode = true;
225225
var useTransforms = process.env.USE_TRANSFORMS || false;
226-
var useTransformCompat = false;
227226
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
228227
var compilerFilename = "tsc.js";
229228
var LKGCompiler = path.join(LKGDirectory, compilerFilename);
@@ -286,9 +285,6 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
286285
if (useBuiltCompiler && useTransforms) {
287286
options += " --experimentalTransforms"
288287
}
289-
else if (useBuiltCompiler && useTransformCompat) {
290-
options += " --transformCompatibleEmit"
291-
}
292288

293289
var cmd = host + " " + compilerPath + " " + options + " ";
294290
cmd = cmd + sources.join(" ");
@@ -417,10 +413,6 @@ task("setTransforms", function() {
417413
useTransforms = true;
418414
});
419415

420-
task("setTransformCompat", function() {
421-
useTransformCompat = true;
422-
});
423-
424416
task("configure-nightly", [configureNightlyJs], function() {
425417
var cmd = host + " " + configureNightlyJs + " " + packageJson + " " + programTs;
426418
console.log(cmd);

src/compiler/commandLineParser.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,6 @@ namespace ts {
327327
name: "experimentalTransforms",
328328
type: "boolean",
329329
experimental: true
330-
},
331-
{
332-
// this option will be removed when this is merged with master and exists solely
333-
// to enable the tree transforming emitter side-by-side with the existing emitter.
334-
name: "transformCompatibleEmit",
335-
type: "boolean",
336-
experimental: true
337330
}
338331
];
339332

src/compiler/emitter.ts

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,9 +1915,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
19151915

19161916
if (multiLine) {
19171917
decreaseIndent();
1918-
if (!compilerOptions.transformCompatibleEmit) {
1919-
writeLine();
1920-
}
19211918
}
19221919

19231920
write(")");
@@ -2237,7 +2234,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22372234
return forEach(elements, e => e.kind === SyntaxKind.SpreadElementExpression);
22382235
}
22392236

2240-
function skipParentheses(node: Expression): Expression {
2237+
function skipParenthesesAndAssertions(node: Expression): Expression {
22412238
while (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.TypeAssertionExpression || node.kind === SyntaxKind.AsExpression) {
22422239
node = (<ParenthesizedExpression | AssertionExpression>node).expression;
22432240
}
@@ -2268,7 +2265,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22682265

22692266
function emitCallWithSpread(node: CallExpression) {
22702267
let target: Expression;
2271-
const expr = skipParentheses(node.expression);
2268+
const expr = skipParenthesesAndAssertions(node.expression);
22722269
if (expr.kind === SyntaxKind.PropertyAccessExpression) {
22732270
// Target will be emitted as "this" argument
22742271
target = emitCallTarget((<PropertyAccessExpression>expr).expression);
@@ -4334,9 +4331,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43344331
writeLine();
43354332
emitStart(restParam);
43364333
emitNodeWithCommentsAndWithoutSourcemap(restParam.name);
4337-
write(restIndex > 0 || !compilerOptions.transformCompatibleEmit
4338-
? `[${tempName} - ${restIndex}] = arguments[${tempName}];`
4339-
: `[${tempName}] = arguments[${tempName}];`);
4334+
write(`[${tempName} - ${restIndex}] = arguments[${tempName}];`);
43404335
emitEnd(restParam);
43414336
decreaseIndent();
43424337
writeLine();
@@ -5356,7 +5351,7 @@ const _super = (function (geti, seti) {
53565351
const isClassExpressionWithStaticProperties = staticProperties.length > 0 && node.kind === SyntaxKind.ClassExpression;
53575352
let tempVariable: Identifier;
53585353

5359-
if (isClassExpressionWithStaticProperties && compilerOptions.transformCompatibleEmit) {
5354+
if (isClassExpressionWithStaticProperties) {
53605355
tempVariable = createAndRecordTempVariable(TempFlags.Auto);
53615356
write("(");
53625357
increaseIndent();
@@ -5393,11 +5388,6 @@ const _super = (function (geti, seti) {
53935388
writeLine();
53945389
emitConstructor(node, baseTypeNode);
53955390
emitMemberFunctionsForES5AndLower(node);
5396-
if (!compilerOptions.transformCompatibleEmit) {
5397-
emitPropertyDeclarations(node, staticProperties);
5398-
writeLine();
5399-
emitDecoratorsOfClass(node, /*decoratedClassAlias*/ undefined);
5400-
}
54015391
writeLine();
54025392
emitToken(SyntaxKind.CloseBraceToken, node.members.end, () => {
54035393
write("return ");
@@ -5424,13 +5414,10 @@ const _super = (function (geti, seti) {
54245414
write("))");
54255415
if (node.kind === SyntaxKind.ClassDeclaration) {
54265416
write(";");
5427-
if (compilerOptions.transformCompatibleEmit) {
5428-
emitPropertyDeclarations(node, staticProperties);
5429-
writeLine();
5430-
emitDecoratorsOfClass(node, /*decoratedClassAlias*/ undefined);
5431-
}
5417+
emitPropertyDeclarations(node, staticProperties);
5418+
emitDecoratorsOfClass(node, /*decoratedClassAlias*/ undefined);
54325419
}
5433-
else if (isClassExpressionWithStaticProperties && compilerOptions.transformCompatibleEmit) {
5420+
else if (isClassExpressionWithStaticProperties) {
54345421
for (const property of staticProperties) {
54355422
write(",");
54365423
writeLine();

src/compiler/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2473,7 +2473,6 @@ namespace ts {
24732473
allowJs?: boolean;
24742474
/* @internal */ stripInternal?: boolean;
24752475
/* @internal */ experimentalTransforms?: boolean;
2476-
/* @internal */ transformCompatibleEmit?: boolean;
24772476

24782477
// Skip checking lib.d.ts to help speed up tests.
24792478
/* @internal */ skipDefaultLibCheck?: boolean;

tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ var Point = (function () {
2828
this.x = x;
2929
this.y = y;
3030
}
31-
Point.Origin = { x: 0, y: 0 };
3231
return Point;
3332
}());
33+
Point.Origin = { x: 0, y: 0 };
3434
var Point;
3535
(function (Point) {
3636
Point.Origin = ""; //expected duplicate identifier error
@@ -42,9 +42,9 @@ var A;
4242
this.x = x;
4343
this.y = y;
4444
}
45-
Point.Origin = { x: 0, y: 0 };
4645
return Point;
4746
}());
47+
Point.Origin = { x: 0, y: 0 };
4848
A.Point = Point;
4949
var Point;
5050
(function (Point) {

tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ var Point = (function () {
2828
this.x = x;
2929
this.y = y;
3030
}
31-
Point.Origin = { x: 0, y: 0 };
3231
return Point;
3332
}());
33+
Point.Origin = { x: 0, y: 0 };
3434
var Point;
3535
(function (Point) {
3636
var Origin = ""; // not an error, since not exported
@@ -42,9 +42,9 @@ var A;
4242
this.x = x;
4343
this.y = y;
4444
}
45-
Point.Origin = { x: 0, y: 0 };
4645
return Point;
4746
}());
47+
Point.Origin = { x: 0, y: 0 };
4848
A.Point = Point;
4949
var Point;
5050
(function (Point) {

tests/baselines/reference/ClassDeclarationWithInvalidConstOnPropertyDeclaration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ class AtomicNumbers {
77
var AtomicNumbers = (function () {
88
function AtomicNumbers() {
99
}
10-
AtomicNumbers.H = 1;
1110
return AtomicNumbers;
1211
}());
12+
AtomicNumbers.H = 1;

tests/baselines/reference/ES5SymbolProperty1.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ obj[Symbol.foo];
1414
var Symbol;
1515
var obj = (_a = {},
1616
_a[Symbol.foo] = 0,
17-
_a
18-
);
17+
_a);
1918
obj[Symbol.foo];
2019
var _a;

tests/baselines/reference/amdImportNotAsPrimaryExpression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ define(["require", "exports"], function (require, exports) {
3838
function C1() {
3939
this.m1 = 42;
4040
}
41-
C1.s1 = true;
4241
return C1;
4342
}());
43+
C1.s1 = true;
4444
exports.C1 = C1;
4545
(function (E1) {
4646
E1[E1["A"] = 0] = "A";

tests/baselines/reference/autolift4.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ var Point = (function () {
3737
Point.prototype.getDist = function () {
3838
return Math.sqrt(this.x * this.x + this.y * this.y);
3939
};
40-
Point.origin = new Point(0, 0);
4140
return Point;
4241
}());
42+
Point.origin = new Point(0, 0);
4343
var Point3D = (function (_super) {
4444
__extends(Point3D, _super);
4545
function Point3D(x, y, z, m) {

0 commit comments

Comments
 (0)
0