fix corner cases in collapse_vars (#4555)

fixes #4554
This commit is contained in:
Alex Lam S.L
2021-01-14 16:22:34 +00:00
committed by GitHub
parent 24917e7084
commit 65d39a3702
2 changed files with 71 additions and 9 deletions

View File

@@ -2456,3 +2456,34 @@ issue_4519_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4554: {
options = {
collapse_vars: true,
unused: true,
}
input: {
A = "PASS";
var a = "FAIL";
try {
(function({}, b) {
return b;
})(void 0, a = A);
} catch (e) {
console.log(a);
}
}
expect: {
A = "PASS";
var a = "FAIL";
try {
(function({}, b) {
return b;
})(void 0, a = A);
} catch (e) {
console.log(a);
}
}
expect_stdout: "PASS"
node_version: ">=6"
}