mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-10 18:04:18 -05:00
Merge pull request #2539 from Microsoft/forOfLengthCache
Remove experimental flag to cache for-of length checks.
This commit is contained in:
2
Jakefile
2
Jakefile
@@ -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");
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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("; ");
|
||||
|
||||
@@ -1588,7 +1588,6 @@ module ts {
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
/* @internal */ cacheDownlevelForOfLength?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user