diff options
author | Mihai Bazon <mihai.bazon@gmail.com> | 2015-06-30 10:07:13 +0300 |
---|---|---|
committer | Mihai Bazon <mihai.bazon@gmail.com> | 2015-06-30 10:10:29 +0300 |
commit | 85a5fc0aeb1785982506c09a484e12608ba01624 (patch) | |
tree | 410520a393448f104c1c5bdad59872fc800be62e | |
parent | 5bf617ebde8edd0720477944f84f69c9adec078e (diff) | |
download | tracifyjs-85a5fc0aeb1785982506c09a484e12608ba01624.tar.gz tracifyjs-85a5fc0aeb1785982506c09a484e12608ba01624.zip |
Don't drop parens in a * (b * c). Close #744
-rw-r--r-- | lib/compress.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js index 530e7c2f..091ad9e5 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -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, |