fix assignment substitution in sequences (#1643)
take side effects of binary boolean operations into account fixes #1639
This commit is contained in:
@@ -2934,7 +2934,12 @@ merge(Compressor.prototype, {
|
||||
return car;
|
||||
}
|
||||
if (cdr instanceof AST_Binary && !(cdr instanceof AST_Assign)) {
|
||||
field = cdr.left.is_constant() ? "right" : "left";
|
||||
if (cdr.left.is_constant()) {
|
||||
if (cdr.operator == "||" || cdr.operator == "&&") break;
|
||||
field = "right";
|
||||
} else {
|
||||
field = "left";
|
||||
}
|
||||
} else if (cdr instanceof AST_Call
|
||||
|| cdr instanceof AST_Unary && cdr.operator != "++" && cdr.operator != "--") {
|
||||
field = "expression";
|
||||
|
||||
Reference in New Issue
Block a user