fix corner case collapse_vars (#4921)

fixes #4920
This commit is contained in:
Alex Lam S.L
2021-05-08 19:59:45 +01:00
committed by GitHub
parent bbca9de9cd
commit bb225367cb
2 changed files with 54 additions and 22 deletions

View File

@@ -9194,3 +9194,29 @@ issue_4918: {
}
expect_stdout: "PASS"
}
issue_4920: {
options = {
collapse_vars: true,
toplevel: true,
}
input: {
var a = "PASS", b;
({
get PASS() {
a = "FAIL";
},
})[b = a];
console.log(b);
}
expect: {
var a = "PASS", b;
({
get PASS() {
a = "FAIL";
},
})[b = a];
console.log(b);
}
expect_stdout: "PASS"
}