Fix compression of conditionals
Don't move the condition on the right side of an assignment when the left side may have side effects. Fix #677
This commit is contained in:
@@ -2343,6 +2343,7 @@ merge(Compressor.prototype, {
|
||||
&& alternative instanceof AST_Assign
|
||||
&& consequent.operator == alternative.operator
|
||||
&& consequent.left.equivalent_to(alternative.left)
|
||||
&& !consequent.left.has_side_effects(compressor)
|
||||
) {
|
||||
/*
|
||||
* Stuff like this:
|
||||
|
||||
Reference in New Issue
Block a user