fix const under collapse_vars without unused (#2454)

fixes #2453
This commit is contained in:
Alex Lam S.L
2017-11-08 02:10:46 +08:00
committed by GitHub
parent 94b19a9c46
commit dd0a36119b
2 changed files with 24 additions and 1 deletions

View File

@@ -3355,3 +3355,25 @@ issue_2437: {
}();
}
}
issue_2453: {
options = {
collapse_vars: true,
toplevel: true,
}
input: {
function log(n) {
console.log(n);
}
const a = 42;
log(a);
}
expect: {
function log(n) {
console.log(n);
}
const a = 42;
log(a);
}
expect_stdout: "42"
}