fix delete related issues in collapse_vars and reduce_vars (#1689)

This commit is contained in:
Alex Lam S.L
2017-03-26 19:14:30 +08:00
committed by GitHub
parent 00996afd2c
commit 861a79ac9f
3 changed files with 46 additions and 28 deletions

View File

@@ -1544,3 +1544,30 @@ issue_1670_6: {
}
expect_stdout: "1"
}
unary_delete: {
options = {
evaluate: true,
reduce_vars: true,
unused: true,
}
input: {
var b = 10;
function f() {
var a;
if (delete a) b--;
}
f();
console.log(b);
}
expect: {
var b = 10;
function f() {
var a;
if (delete a) b--;
}
f();
console.log(b);
}
expect_stdout: true
}