fix corner case in collapse_vars (#5503)

fixes #5502
This commit is contained in:
Alex Lam S.L
2022-06-09 19:07:07 +01:00
committed by GitHub
parent f749863cb2
commit 25017978e7
2 changed files with 57 additions and 7 deletions

View File

@@ -3143,3 +3143,39 @@ issue_5489_strict: {
]
node_version: ">=16"
}
issue_5502: {
options = {
collapse_vars: true,
}
input: {
"use strict";
var a = "FAIL";
class A {
static p = a;
[a = "PASS"];
}
try {
b++;
} finally {
var a, b = 42;
}
console.log(a, b);
}
expect: {
"use strict";
var a = "FAIL";
class A {
static p = a;
[a = "PASS"];
}
try {
b++;
} finally {
var a, b = 42;
}
console.log(a, b);
}
expect_stdout: "PASS 42"
node_version: ">=12"
}