diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index be6a4dc36fc..aba0c883aaa 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -3237,9 +3237,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge !loop.state.labeledNonLocalBreaks && !loop.state.labeledNonLocalContinues; - copyLoopOutParameters(loop.state, CopyDirection.ToOutParameter, /*emitAsStatements*/ true); - writeLine(); - const loopResult = makeUniqueName("state"); if (!isSimpleLoop) { write(`var ${loopResult} = `); diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js index 84e013c3b02..609d353fbc7 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop1.js @@ -16,7 +16,6 @@ declare function use(n: number): void; }; var out_i_1; for (var i = 0; i < 9; ++i) { - out_i_1 = i; _loop_1(i); i = out_i_1; } diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js index 82719448e24..c48ecd96ffe 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop2.js @@ -55,8 +55,6 @@ var _loop_1 = function(x, y) { }; var out_x_1, out_y_1; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_1 = x; - out_y_1 = y; var state_1 = _loop_1(x, y); x = out_x_1; y = out_y_1; @@ -75,8 +73,6 @@ var _loop_2 = function(x, y) { }; var out_x_2, out_y_2; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_2 = x; - out_y_2 = y; var state_2 = _loop_2(x, y); x = out_x_2; y = out_y_2; @@ -95,8 +91,6 @@ var _loop_3 = function(x, y) { }; var out_x_3, out_y_3; loop: for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_3 = x; - out_y_3 = y; var state_3 = _loop_3(x, y); x = out_x_3; y = out_y_3; @@ -117,8 +111,6 @@ var _loop_4 = function(x, y) { }; var out_x_4, out_y_4; loop: for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_4 = x; - out_y_4 = y; var state_4 = _loop_4(x, y); x = out_x_4; y = out_y_4; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js index 8780afbdf54..10160202621 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop3.js @@ -112,7 +112,6 @@ var _loop_1 = function(x, y) { }; var out_a_1_1; for (var a_1 = 1; a_1 < 5; --a_1) { - out_a_1_1 = a_1; var state_1 = _loop_2(a_1); a_1 = out_a_1_1; if (state_1 === "break") break; @@ -124,8 +123,6 @@ var _loop_1 = function(x, y) { }; var out_x_1, out_y_1; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_1 = x; - out_y_1 = y; var state_2 = _loop_1(x, y); x = out_x_1; y = out_y_1; @@ -150,7 +147,6 @@ var _loop_3 = function(x, y) { }; var out_a_2_1; for (var a_2 = 1; a_2 < 5; --a_2) { - out_a_2_1 = a_2; var state_3 = _loop_4(a_2); a_2 = out_a_2_1; if (state_3 === "continue") continue; @@ -162,8 +158,6 @@ var _loop_3 = function(x, y) { }; var out_x_2, out_y_2; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_2 = x; - out_y_2 = y; var state_4 = _loop_3(x, y); x = out_x_2; y = out_y_2; @@ -189,7 +183,6 @@ var _loop_5 = function(x, y) { }; var out_a_3_1; loop1: for (var a_3 = 1; a_3 < 5; --a_3) { - out_a_3_1 = a_3; var state_5 = _loop_6(a_3); a_3 = out_a_3_1; switch(state_5) { @@ -204,8 +197,6 @@ var _loop_5 = function(x, y) { }; var out_x_3, out_y_3; loop2: for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_3 = x; - out_y_3 = y; var state_6 = _loop_5(x, y); x = out_x_3; y = out_y_3; @@ -233,7 +224,6 @@ var _loop_7 = function(x, y) { }; var out_a_4_1; loop1: for (var a_4 = 1; a_4 < 5; --a_4) { - out_a_4_1 = a_4; var state_7 = _loop_8(a_4); a_4 = out_a_4_1; switch(state_7) { @@ -248,8 +238,6 @@ var _loop_7 = function(x, y) { }; var out_x_4, out_y_4; loop2: for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_4 = x; - out_y_4 = y; var state_8 = _loop_7(x, y); x = out_x_4; y = out_y_4; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js index e28c890932a..8bff867dc95 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop4.js @@ -26,8 +26,6 @@ function f1() { }; var out_x_1, out_y_1; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_1 = x; - out_y_1 = y; var state_1 = _loop_1(x, y); x = out_x_1; y = out_y_1; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js index 198303390c9..a891147317d 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop5.js @@ -20,8 +20,6 @@ var _loop_1 = function(x, y) { }; var out_x_1, out_y_1; for (var x = 1, y = 2; x < y; ++x, --y) { - out_x_1 = x; - out_y_1 = y; var state_1 = _loop_1(x, y); x = out_x_1; y = out_y_1; diff --git a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js index f958b29c583..a2a074ed4df 100644 --- a/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js +++ b/tests/baselines/reference/blockScopedBindingsReassignedInLoop6.js @@ -44,8 +44,6 @@ function f1() { }; var out_x_1, out_y_1; for (var _a = [1, 2], x = _a[0], y = _a[1]; x < y; ++x, --y) { - out_x_1 = x; - out_y_1 = y; var state_1 = _loop_1(x, y); x = out_x_1; y = out_y_1; @@ -67,8 +65,6 @@ function f2() { }; var out_x_2, out_y_2; for (var _a = [{ a: 1, b: { c: 2 } }][0], x = _a.a, y = _a.b.c; x < y; ++x, --y) { - out_x_2 = x; - out_y_2 = y; var state_2 = _loop_2(x, y); x = out_x_2; y = out_y_2; diff --git a/tests/baselines/reference/nestedBlockScopedBindings3.js b/tests/baselines/reference/nestedBlockScopedBindings3.js index 4570e85d510..f9474381816 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings3.js +++ b/tests/baselines/reference/nestedBlockScopedBindings3.js @@ -127,7 +127,6 @@ function a4() { }; var out_x_1; for (var x = void 0; x < 1;) { - out_x_1 = x; _loop_5(x); x = out_x_1; } @@ -145,7 +144,6 @@ function a5() { }; var out_x_2; for (var x = void 0; x < 1;) { - out_x_2 = x; _loop_6(x); x = out_x_2; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings4.js b/tests/baselines/reference/nestedBlockScopedBindings4.js index 832feb588bc..6b391070d93 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings4.js +++ b/tests/baselines/reference/nestedBlockScopedBindings4.js @@ -57,7 +57,6 @@ function a1() { }; var out_x_1; for (var x = void 0; x < 1;) { - out_x_1 = x; _loop_1(x); x = out_x_1; } @@ -76,7 +75,6 @@ function a2() { }; var out_x_2; for (var x = void 0;;) { - out_x_2 = x; _loop_2(x); x = out_x_2; } @@ -89,7 +87,6 @@ function a3() { }; var out_x_3; for (var x = void 0; x < 1;) { - out_x_3 = x; _loop_3(x); x = out_x_3; } @@ -100,7 +97,6 @@ function a3() { }; var out_x_4; for (var x = void 0;;) { - out_x_4 = x; _loop_4(x); x = out_x_4; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings5.js b/tests/baselines/reference/nestedBlockScopedBindings5.js index af91e9999a6..df4fcf76423 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings5.js +++ b/tests/baselines/reference/nestedBlockScopedBindings5.js @@ -112,7 +112,6 @@ function a2() { }; var out_x_1; for (var x = void 0;;) { - out_x_1 = x; _loop_2(x); x = out_x_1; } @@ -132,7 +131,6 @@ function a3() { }; var out_x_2; for (var x = void 0; false;) { - out_x_2 = x; _loop_4(x); x = out_x_2; } @@ -169,7 +167,6 @@ function a5() { }; var out_x_3; for (var x = void 0; false;) { - out_x_3 = x; _loop_5(x); x = out_x_3; } diff --git a/tests/baselines/reference/nestedBlockScopedBindings6.js b/tests/baselines/reference/nestedBlockScopedBindings6.js index 43f61a23bbf..be9771471e9 100644 --- a/tests/baselines/reference/nestedBlockScopedBindings6.js +++ b/tests/baselines/reference/nestedBlockScopedBindings6.js @@ -123,7 +123,6 @@ function a2() { }; var out_x_1; for (var x = void 0;;) { - out_x_1 = x; _loop_2(x); x = out_x_1; } @@ -144,7 +143,6 @@ function a3() { }; var out_x_2; for (var x = void 0;;) { - out_x_2 = x; _loop_4(x); x = out_x_2; }