fix collapse_vars on switch (#2578)
This commit is contained in:
@@ -873,14 +873,12 @@ merge(Compressor.prototype, {
|
||||
node.expression = node.expression.transform(scanner);
|
||||
for (var i = 0, len = node.body.length; !abort && i < len; i++) {
|
||||
var branch = node.body[i];
|
||||
if (branch instanceof AST_Case)
|
||||
if (branch instanceof AST_Case) {
|
||||
branch.expression = branch.expression.transform(scanner);
|
||||
if (side_effects || !replace_all) break;
|
||||
}
|
||||
}
|
||||
for (i = 0; !abort && i < len; i++) {
|
||||
var branch = node.body[i];
|
||||
for (var j = 0, len2 = branch.body.length; j < len2; j++)
|
||||
branch.body[j] = branch.body[j].transform(scanner);
|
||||
}
|
||||
abort = true;
|
||||
return node;
|
||||
}
|
||||
// Skip nodes before `candidate` as quickly as possible
|
||||
|
||||
Reference in New Issue
Block a user