handle global constant collision with local variable after inline (#2617)

fixes #2616
This commit is contained in:
Alex Lam S.L
2017-12-19 03:05:30 +08:00
committed by GitHub
parent 8ddcbc39e6
commit 4b334edf49
2 changed files with 38 additions and 1 deletions

View File

@@ -1049,3 +1049,37 @@ unsafe_call_2: {
}
expect_stdout: true
}
issue_2616: {
options = {
evaluate: true,
inline: true,
reduce_vars: true,
side_effects: true,
unused: true,
}
input: {
var c = "FAIL";
(function() {
function f() {
function g(NaN) {
(true << NaN) - 0/0 || (c = "PASS");
}
g([]);
}
f();
})();
console.log(c);
}
expect: {
var c = "FAIL";
(function() {
(function() {
NaN = [], (true << NaN) - 0/0 || (c = "PASS");
var NaN;
})();
})();
console.log(c);
}
expect_stdout: "PASS"
}