fix corner case in collapse_vars (#4391)

fixes #4390
This commit is contained in:
Alex Lam S.L
2020-12-17 19:10:16 +00:00
committed by GitHub
parent 02fdcfde01
commit ab82be82b2
2 changed files with 32 additions and 1 deletions

View File

@@ -351,3 +351,32 @@ issue_4388: {
expect_stdout: "undefined"
node_version: ">=4"
}
issue_4390: {
options = {
collapse_vars: true,
}
input: {
function log() {
console.log.apply(console, arguments);
}
var a = 42, b = "FAIL";
b = "PASS";
(c => log(b, c))(a);
log(b);
}
expect: {
function log() {
console.log.apply(console, arguments);
}
var a = 42, b = "FAIL";
b = "PASS";
(c => log(b, c))(a);
log(b);
}
expect_stdout: [
"PASS 42",
"PASS",
]
node_version: ">=4"
}