Merge pull request #2539 from Microsoft/forOfLengthCache

Remove experimental flag to cache for-of length checks.
This commit is contained in:
CyrusNajmabadi
2015-03-29 22:12:43 -07:00
4 changed files with 2 additions and 26 deletions

View File

@@ -254,8 +254,6 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
options += " --stripInternal"
}
options += " --cacheDownlevelForOfLength";
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
cmd = cmd + sources.join(" ");
console.log(cmd + "\n");

View File

@@ -140,12 +140,6 @@ module ts {
description: Diagnostics.Do_not_emit_declarations_for_code_that_has_an_internal_annotation,
experimental: true
},
{
name: "cacheDownlevelForOfLength",
type: "boolean",
description: "Cache length access when downlevel emitting for-of statements",
experimental: true,
},
{
name: "target",
shortName: "t",

View File

@@ -2167,8 +2167,6 @@ module ts {
let counter = createTempVariable(TempFlags._i);
let rhsReference = rhsIsIdentifier ? <Identifier>node.expression : createTempVariable(TempFlags.Auto);
var cachedLength = compilerOptions.cacheDownlevelForOfLength ? createTempVariable(TempFlags._n) : undefined;
// This is the let keyword for the counter and rhsReference. The let keyword for
// the LHS will be emitted inside the body.
emitStart(node.expression);
@@ -2189,14 +2187,6 @@ module ts {
emitEnd(node.expression);
}
if (cachedLength) {
write(", ");
emitNodeWithoutSourceMap(cachedLength);
write(" = ");
emitNodeWithoutSourceMap(rhsReference);
write(".length");
}
write("; ");
// _i < _a.length;
@@ -2204,13 +2194,8 @@ module ts {
emitNodeWithoutSourceMap(counter);
write(" < ");
if (cachedLength) {
emitNodeWithoutSourceMap(cachedLength);
}
else {
emitNodeWithoutSourceMap(rhsReference);
write(".length");
}
emitNodeWithoutSourceMap(rhsReference);
write(".length");
emitEnd(node.initializer);
write("; ");

View File

@@ -1588,7 +1588,6 @@ module ts {
version?: boolean;
watch?: boolean;
/* @internal */ stripInternal?: boolean;
/* @internal */ cacheDownlevelForOfLength?: boolean;
[option: string]: string | number | boolean;
}