fix corner case in collapse_vars (#5390)

fixes #5389
This commit is contained in:
Alex Lam S.L
2022-03-22 05:05:57 +00:00
committed by GitHub
parent a8e040b133
commit c624b43739
3 changed files with 35 additions and 1 deletions

View File

@@ -2538,3 +2538,34 @@ issue_5387: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_5389: {
options = {
collapse_vars: true,
toplevel: true,
}
input: {
function log(m, n) {
console.log(m, n);
}
var a = log;
class A {
[a = "FAIL"] = a = "PASS";
}
var b = new A();
log(a, b.FAIL);
}
expect: {
function log(m, n) {
console.log(m, n);
}
var a = log;
class A {
[a = "FAIL"] = a = "PASS";
}
var b = new A();
log(a, b.FAIL);
}
expect_stdout: "PASS PASS"
node_version: ">=12"
}