Don't drop parens in a * (b * c). Close #744

This commit is contained in:
Mihai Bazon
2015-06-30 10:07:13 +03:00
parent 5bf617ebde
commit 85a5fc0aeb

View File

@@ -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,