fix corner case in reduce_vars (#4938)

fixes #4937
This commit is contained in:
Alex Lam S.L
2021-05-15 15:38:09 +01:00
committed by GitHub
parent bbed9b13b1
commit a7698f8845
2 changed files with 32 additions and 1 deletions

View File

@@ -7631,3 +7631,34 @@ issue_4568: {
}
expect_stdout: "PASS"
}
issue_4937: {
options = {
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f() {
while (console.log("PASS"));
}
do {
function g() {
f();
}
} while (!g);
f();
}
expect: {
function f() {
while (console.log("PASS"));
}
do {
function g() {
f();
}
} while (!g);
f();
}
expect_stdout: "PASS"
}