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

@@ -348,6 +348,16 @@ merge(Compressor.prototype, {
pop();
return true;
}
if (node instanceof AST_Conditional) {
node.condition.walk(tw);
push();
node.consequent.walk(tw);
pop();
push();
node.alternative.walk(tw);
pop();
return true;
}
if (node instanceof AST_If) {
node.condition.walk(tw);
push();