enhance side_effects (#3383)
This commit is contained in:
@@ -4172,10 +4172,18 @@ merge(Compressor.prototype, {
|
||||
var right = this.right.drop_side_effect_free(compressor, first_in_statement);
|
||||
if (!right) return this.left.drop_side_effect_free(compressor, first_in_statement);
|
||||
if (lazy_op[this.operator]) {
|
||||
if (right === this.right) return this;
|
||||
var node = this.clone();
|
||||
node.right = right.drop_side_effect_free(compressor);
|
||||
return node;
|
||||
var node;
|
||||
if (right === this.right) {
|
||||
node = this;
|
||||
} else {
|
||||
node = this.clone();
|
||||
node.right = right.drop_side_effect_free(compressor);
|
||||
}
|
||||
return (first_in_statement ? best_of_statement : best_of_expression)(node, make_node(AST_Binary, this, {
|
||||
operator: node.operator == "&&" ? "||" : "&&",
|
||||
left: node.left.negate(compressor, first_in_statement),
|
||||
right: node.right
|
||||
}));
|
||||
} else {
|
||||
var left = this.left.drop_side_effect_free(compressor, first_in_statement);
|
||||
if (!left) return right;
|
||||
|
||||
Reference in New Issue
Block a user