fix reduce_vars on conditionals (#1822)

This commit is contained in:
Alex Lam S.L
2017-04-18 01:44:23 +08:00
committed by GitHub
parent 6d5f341999
commit d1aa09c5c7
2 changed files with 33 additions and 0 deletions

View File

@@ -2240,3 +2240,26 @@ boolean_binary_assign: {
}
expect_stdout: "undefined"
}
cond_assign: {
options = {
evaluate: true,
reduce_vars: true,
unused: true,
}
input: {
!function() {
var a;
void 0 ? (a = 1) : 0;
console.log(a);
}();
}
expect: {
!function() {
var a;
void 0 ? (a = 1) : 0;
console.log(a);
}();
}
expect_stdout: "undefined"
}