enhance side_effects (#3384)
This commit is contained in:
@@ -4172,10 +4172,8 @@ 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]) {
|
||||
var node;
|
||||
if (right === this.right) {
|
||||
node = this;
|
||||
} else {
|
||||
var node = this;
|
||||
if (right !== node.right) {
|
||||
node = this.clone();
|
||||
node.right = right.drop_side_effect_free(compressor);
|
||||
}
|
||||
@@ -4559,14 +4557,14 @@ merge(Compressor.prototype, {
|
||||
operator : "||",
|
||||
left : negated,
|
||||
right : self.body.body
|
||||
})
|
||||
}).transform(compressor)
|
||||
}).optimize(compressor);
|
||||
return make_node(AST_SimpleStatement, self, {
|
||||
body: make_node(AST_Binary, self, {
|
||||
operator : "&&",
|
||||
left : self.condition,
|
||||
right : self.body.body
|
||||
})
|
||||
}).transform(compressor)
|
||||
}).optimize(compressor);
|
||||
}
|
||||
if (self.body instanceof AST_EmptyStatement
|
||||
@@ -4576,7 +4574,7 @@ merge(Compressor.prototype, {
|
||||
operator : "||",
|
||||
left : self.condition,
|
||||
right : self.alternative.body
|
||||
})
|
||||
}).transform(compressor)
|
||||
}).optimize(compressor);
|
||||
}
|
||||
if (self.body instanceof AST_Exit
|
||||
|
||||
Reference in New Issue
Block a user