Don't drop parens in a * (b * c). Close #744
authorMihai Bazon <mihai.bazon@gmail.com>
Tue, 30 Jun 2015 07:07:13 +0000 (10:07 +0300)
committerMihai Bazon <mihai.bazon@gmail.com>
Tue, 30 Jun 2015 07:10:29 +0000 (10:10 +0300)
lib/compress.js

index 530e7c2..091ad9e 100644 (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
             && self.right.operator == self.operator
-            && (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
+            && (self.operator == "&&" || self.operator == "||"))
         {
             self.left = make_node(AST_Binary, self.left, {
                 operator : self.operator,