collapse within unary expressions (#2910)

This commit is contained in:
Alex Lam S.L
2018-02-13 07:10:37 +08:00
committed by GitHub
parent 0c4f315c02
commit d8e0e34354
2 changed files with 4 additions and 1 deletions

View File

@@ -1260,6 +1260,8 @@ merge(Compressor.prototype, {
} else if (expr instanceof AST_Unary) {
if (expr.operator == "++" || expr.operator == "--") {
candidates.push(hit_stack.slice());
} else {
extract_candidates(expr.expression);
}
} else if (expr instanceof AST_VarDef) {
if (expr.value) {
@@ -1314,6 +1316,7 @@ merge(Compressor.prototype, {
return find_stop(parent, level + 1, true);
}
if (parent instanceof AST_Switch) return node;
if (parent instanceof AST_Unary) return node;
if (parent instanceof AST_VarDef) return node;
return null;
}