@@ -1397,15 +1397,24 @@ Compressor.prototype.compress = function(node) {
13971397 first = false;
13981398 push(tw, true);
13991399 }
1400- })
1400+ });
14011401 if (!first) pop(tw);
1402- walk_body(node, tw);
1402+ var defined_ids = tw.defined_ids;
1403+ var safe_ids = tw.safe_ids;
1404+ node.body.forEach(function(branch) {
1405+ push(tw, true);
1406+ branch.walk(tw);
1407+ if (aborts(branch)) {
1408+ tw.defined_ids = defined_ids;
1409+ tw.safe_ids = safe_ids;
1410+ }
1411+ });
1412+ tw.defined_ids = defined_ids;
1413+ tw.safe_ids = safe_ids;
14031414 return true;
14041415 });
14051416 def(AST_SwitchBranch, function(tw) {
1406- push(tw, true);
14071417 walk_body(this, tw);
1408- pop(tw);
14091418 return true;
14101419 });
14111420 def(AST_SymbolCatch, function() {
@@ -1501,7 +1510,7 @@ Compressor.prototype.compress = function(node) {
15011510 }
15021511 mark_fn_def(tw, d, value);
15031512 });
1504- def(AST_Template, function(tw, descend ) {
1513+ def(AST_Template, function(tw) {
15051514 var node = this;
15061515 var tag = node.tag;
15071516 if (!tag) return;
@@ -1549,7 +1558,7 @@ Compressor.prototype.compress = function(node) {
15491558 if (node.bfinally) node.bfinally.walk(tw);
15501559 return true;
15511560 });
1552- def(AST_Unary, function(tw, descend ) {
1561+ def(AST_Unary, function(tw) {
15531562 var node = this;
15541563 if (!UNARY_POSTFIX[node.operator]) return;
15551564 var exp = node.expression;
0 commit comments