account for side-effects in comparisons of null & undefined (#2863)
This commit is contained in:
@@ -4800,6 +4800,7 @@ merge(Compressor.prototype, {
|
||||
&& lhs.operator == self.right.operator
|
||||
&& (is_undefined(lhs.left, compressor) && self.right.left instanceof AST_Null
|
||||
|| lhs.left instanceof AST_Null && is_undefined(self.right.left, compressor))
|
||||
&& !lhs.right.has_side_effects(compressor)
|
||||
&& lhs.right.equivalent_to(self.right.right)) {
|
||||
var combined = make_node(AST_Binary, self, {
|
||||
operator: lhs.operator.slice(0, -1),
|
||||
|
||||
Reference in New Issue
Block a user