diff --git a/Jakefile b/Jakefile index 12d47d1b1a330..665bb807b4385 100644 --- a/Jakefile +++ b/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"); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index b43f011579838..4ba2da757e5d8 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -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", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 3c1d12515cfba..366bb1856ea39 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2167,8 +2167,6 @@ module ts { let counter = createTempVariable(TempFlags._i); let rhsReference = rhsIsIdentifier ? 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("; "); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 888caf01b3f8b..d24ee45e21e13 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1588,7 +1588,6 @@ module ts { version?: boolean; watch?: boolean; /* @internal */ stripInternal?: boolean; - /* @internal */ cacheDownlevelForOfLength?: boolean; [option: string]: string | number | boolean; }