fix corner case in merge_vars (#4102)

fixes #4101
This commit is contained in:
Alex Lam S.L
2020-09-15 12:18:12 +01:00
committed by GitHub
parent 3ac575f2e8
commit d64d0b0bec
2 changed files with 40 additions and 0 deletions

View File

@@ -4403,6 +4403,17 @@ merge(Compressor.prototype, {
mark(node);
return true;
}
if (node instanceof AST_Try) {
var save = segment;
segment = node;
node.body.forEach(function(branch) {
branch.walk(tw);
});
if (node.bcatch) node.bcatch.walk(tw);
segment = save;
if (node.bfinally) node.bfinally.walk(tw);
return true;
}
if (node instanceof AST_Unary) {
if (!unary_arithmetic[node.operator]) return;
var sym = node.expression;