fix corner case collapse_vars (#5569)

fixes #5568
This commit is contained in:
Alex Lam S.L
2022-07-18 02:04:51 +01:00
committed by GitHub
parent ec4558be29
commit f0120e90b6
4 changed files with 36 additions and 1 deletions

View File

@@ -9979,3 +9979,25 @@ issue_5396: {
}
expect_stdout: "PASS"
}
issue_5568: {
options = {
collapse_vars: true,
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
A = "FAIL";
var a = (A = "PASS", !1);
for (var b in a);
console.log(A);
}
expect: {
A = "FAIL";
for (var b in !(A = "PASS"));
console.log(A);
}
expect_stdout: "PASS"
}