fix corner case in loops (#4275)

fixes #4274
This commit is contained in:
Alex Lam S.L
2020-11-13 18:08:05 +00:00
committed by GitHub
parent fba27bfb71
commit 6fd5b5b371
3 changed files with 109 additions and 1 deletions

View File

@@ -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"
}