fix corner case in reduce_vars (#4585)

fixes #4584
This commit is contained in:
Alex Lam S.L
2021-01-23 19:37:52 +00:00
committed by GitHub
parent f87e7be12c
commit acc443b2cf
3 changed files with 45 additions and 9 deletions

View File

@@ -2487,3 +2487,30 @@ issue_4554: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4584: {
options = {
evaluate: true,
reduce_vars: true,
}
input: {
try {
(function f({
[console.log(a = "FAIL")]: a,
}) {})(0);
} catch (e) {
console.log("PASS");
}
}
expect: {
try {
(function f({
[console.log(a = "FAIL")]: a,
}) {})(0);
} catch (e) {
console.log("PASS");
}
}
expect_stdout: "PASS"
node_version: ">=6"
}