fix corner case in reduce_vars (#4582)

fixes #4581
This commit is contained in:
Alex Lam S.L
2021-01-22 18:14:53 +00:00
committed by GitHub
parent c0614654d9
commit f87e7be12c
2 changed files with 22 additions and 1 deletions

View File

@@ -1003,3 +1003,24 @@ issue_4534: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4581: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = "PASS";
(async () => (A, a = "FAIL"))();
console.log(a);
}
expect: {
var a = "PASS";
(async () => (A, a = "FAIL"))();
console.log(a);
}
expect_stdout: "PASS"
node_version: ">=8"
}