fix reduce_vars on AST_Switch (#1671)

Take conditional nature of switch branches into account.

fixes #1670
This commit is contained in:
Alex Lam S.L
2017-03-25 21:17:30 +08:00
committed by GitHub
parent 6e86ee950d
commit 0a65de89b9
2 changed files with 181 additions and 1 deletions

View File

@@ -341,7 +341,7 @@ merge(Compressor.prototype, {
pop();
return true;
}
if (node instanceof AST_Catch) {
if (node instanceof AST_Catch || node instanceof AST_SwitchBranch) {
push();
descend();
pop();