fix reduce_vars within try-block (#1818)

Possible partial execution due to exceptions.
This commit is contained in:
Alex Lam S.L
2017-04-17 14:03:29 +08:00
committed by alexlamsl
parent 43ad4e9775
commit 6ad823d1e8
2 changed files with 44 additions and 1 deletions

View File

@@ -359,7 +359,19 @@ merge(Compressor.prototype, {
pop();
return true;
}
if (node instanceof AST_Catch || node instanceof AST_SwitchBranch) {
if (node instanceof AST_Try) {
push();
walk_body(node, tw);
pop();
if (node.bcatch) {
push();
node.bcatch.walk(tw);
pop();
}
if (node.bfinally) node.bfinally.walk(tw);
return true;
}
if (node instanceof AST_SwitchBranch) {
push();
descend();
pop();