fix corner case in collapse_vars (#4605)

fixes #4604
This commit is contained in:
Alex Lam S.L
2021-02-01 15:24:11 +00:00
committed by GitHub
parent ba6e29d6fd
commit b27b6807cb
2 changed files with 25 additions and 0 deletions

View File

@@ -198,3 +198,27 @@ unsafe_side_effects: {
expect_stdout: "foo"
node_version: ">=4"
}
issue_4604: {
options = {
collapse_vars: true,
}
input: {
var a = 0, log = console.log;
a = "FAIL";
(function() {
a = "PASS";
})``;
log(a);
}
expect: {
var a = 0, log = console.log;
a = "FAIL";
(function() {
a = "PASS";
})``;
log(a);
}
expect_stdout: "PASS"
node_version: ">=4"
}