Skip to content

Commit 7fff53c

Browse files
Remove experimental flag to cache for-of length checks.
1 parent 485b5a1 commit 7fff53c

File tree

4 files changed

+3
-25
lines changed

4 files changed

+3
-25
lines changed

Jakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
254254
options += " --stripInternal"
255255
}
256256

257-
options += " --cacheDownlevelForOfLength --preserveNewLines";
257+
options += " --preserveNewLines";
258258

259259
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
260260
cmd = cmd + sources.join(" ");

src/compiler/commandLineParser.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,6 @@ module ts {
146146
description: Diagnostics.Preserve_new_lines_when_emitting_code,
147147
experimental: true
148148
},
149-
{
150-
name: "cacheDownlevelForOfLength",
151-
type: "boolean",
152-
description: "Cache length access when downlevel emitting for-of statements",
153-
experimental: true,
154-
},
155149
{
156150
name: "target",
157151
shortName: "t",

src/compiler/emitter.ts

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,8 +2168,6 @@ module ts {
21682168
let counter = createTempVariable(TempFlags._i);
21692169
let rhsReference = rhsIsIdentifier ? <Identifier>node.expression : createTempVariable(TempFlags.Auto);
21702170

2171-
var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(TempFlags._n) : undefined;
2172-
21732171
// This is the let keyword for the counter and rhsReference. The let keyword for
21742172
// the LHS will be emitted inside the body.
21752173
emitStart(node.expression);
@@ -2190,28 +2188,15 @@ module ts {
21902188
emitEnd(node.expression);
21912189
}
21922190

2193-
if (cachedLength) {
2194-
write(", ");
2195-
emitNodeWithoutSourceMap(cachedLength);
2196-
write(" = ");
2197-
emitNodeWithoutSourceMap(rhsReference);
2198-
write(".length");
2199-
}
2200-
22012191
write("; ");
22022192

22032193
// _i < _a.length;
22042194
emitStart(node.initializer);
22052195
emitNodeWithoutSourceMap(counter);
22062196
write(" < ");
22072197

2208-
if (cachedLength) {
2209-
emitNodeWithoutSourceMap(cachedLength);
2210-
}
2211-
else {
2212-
emitNodeWithoutSourceMap(rhsReference);
2213-
write(".length");
2214-
}
2198+
emitNodeWithoutSourceMap(rhsReference);
2199+
write(".length");
22152200

22162201
emitEnd(node.initializer);
22172202
write("; ");

src/compiler/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1589,7 +1589,6 @@ module ts {
15891589
watch?: boolean;
15901590
/* @internal */ stripInternal?: boolean;
15911591
/* @internal */ preserveNewLines?: boolean;
1592-
/* @internal */ cacheDownlevelForOfLength?: boolean;
15931592
[option: string]: string | number | boolean;
15941593
}
15951594

0 commit comments

Comments
 (0)