fix corner case in collapse_vars (#4919)

fixes #4918
This commit is contained in:
Alex Lam S.L
2021-05-07 20:58:29 +01:00
committed by GitHub
parent ee9ceb79ca
commit bbca9de9cd
2 changed files with 44 additions and 23 deletions

View File

@@ -9171,3 +9171,26 @@ issue_4914: {
}
expect_stdout: "function"
}
issue_4918: {
options = {
collapse_vars: true,
}
input: {
var a = "FAIL";
({
get 42() {
console.log(a);
}
}[a = "PASS", 42] += "PASS");
}
expect: {
var a = "FAIL";
({
get 42() {
console.log(a);
}
}[a = "PASS", 42] += "PASS");
}
expect_stdout: "PASS"
}