diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/const.js | 50 | ||||
-rw-r--r-- | test/compress/let.js | 56 |
2 files changed, 106 insertions, 0 deletions
diff --git a/test/compress/const.js b/test/compress/const.js index 9ffb0d34..333171b4 100644 --- a/test/compress/const.js +++ b/test/compress/const.js @@ -1175,3 +1175,53 @@ issue_4261: { } expect_stdout: "42" } + +issue_4274_1: { + options = { + loops: true, + } + input: { + for (;;) { + if (console.log("PASS")) { + const a = 0; + } else { + break; + var a; + } + } + } + expect: { + for (; console.log("PASS");) { + { + const a = 0; + } + var a; + } + } + expect_stdout: true +} + +issue_4274_2: { + options = { + loops: true, + } + input: { + for (;;) { + if (!console.log("PASS")) { + break; + var a; + } else { + const a = 0; + } + } + } + expect: { + for (; console.log("PASS");) { + { + const a = 0; + } + var a; + } + } + expect_stdout: true +} diff --git a/test/compress/let.js b/test/compress/let.js index 9a6fc944..728e40b4 100644 --- a/test/compress/let.js +++ b/test/compress/let.js @@ -950,3 +950,59 @@ issue_4248: { expect_stdout: "PASS" node_version: ">=4" } + +issue_4274_1: { + options = { + loops: true, + } + input: { + "use strict"; + for (;;) { + if (console.log("PASS")) { + let a; + } else { + break; + var a; + } + } + } + expect: { + "use strict"; + for (; console.log("PASS");) { + { + let a; + } + var a; + } + } + expect_stdout: "PASS" + node_version: ">=4" +} + +issue_4274_2: { + options = { + loops: true, + } + input: { + "use strict"; + for (;;) { + if (!console.log("PASS")) { + break; + var a; + } else { + let a; + } + } + } + expect: { + "use strict"; + for (; console.log("PASS");) { + { + let a; + } + var a; + } + } + expect_stdout: "PASS" + node_version: ">=4" +} |