fix corner case in collapse_vars (#4936)

fixes #4935
This commit is contained in:
Alex Lam S.L
2021-05-15 15:34:14 +01:00
committed by GitHub
parent 2cff7c94e8
commit bbed9b13b1
2 changed files with 26 additions and 0 deletions

View File

@@ -9220,3 +9220,28 @@ issue_4920: {
}
expect_stdout: "PASS"
}
issue_4935: {
options = {
collapse_vars: true,
reduce_vars: true,
toplevel: true,
}
input: {
var a = 1;
var b;
var c = b = a;
console || c(a++);
--b;
console.log(a, b);
}
expect: {
var a = 1;
var b;
var c = b = a;
console || a(a++);
--b;
console.log(a, b);
}
expect_stdout: "1 0"
}