fix corner case in collapse_vars (#4332)

fixes #4331
This commit is contained in:
Alex Lam S.L
2020-12-06 10:30:50 +00:00
committed by GitHub
parent 37f4f56752
commit 3c384cf9a8
2 changed files with 27 additions and 0 deletions

View File

@@ -399,3 +399,29 @@ issue_4329: {
expect_stdout: "PASS"
node_version: ">=8"
}
issue_4331: {
options = {
collapse_vars: true,
toplevel: true,
}
input: {
var a = "PASS", b;
console,
b = a;
(function() {
a++;
})(...a);
console.log(b);
}
expect: {
var a = "PASS", b;
console;
(function() {
a++;
})(...b = a);
console.log(b);
}
expect_stdout: "PASS"
node_version: ">=8"
}