Don't drop parens in a * (b * c). Close #744
This commit is contained in:
@@ -2230,10 +2230,11 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// x * (y * z) ==> x * y * z
|
// x && (y && z) ==> x && y && z
|
||||||
|
// x || (y || z) ==> x || y || z
|
||||||
if (self.right instanceof AST_Binary
|
if (self.right instanceof AST_Binary
|
||||||
&& self.right.operator == self.operator
|
&& self.right.operator == self.operator
|
||||||
&& (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
|
&& (self.operator == "&&" || self.operator == "||"))
|
||||||
{
|
{
|
||||||
self.left = make_node(AST_Binary, self.left, {
|
self.left = make_node(AST_Binary, self.left, {
|
||||||
operator : self.operator,
|
operator : self.operator,
|
||||||
|
|||||||
Reference in New Issue
Block a user