This commit is contained in:
Alex Lam S.L 2017-02-12 09:37:13 +00:00 committed by GitHub
commit 9beed3f03e

View File

@ -2670,9 +2670,10 @@ merge(Compressor.prototype, {
}
// 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 == "||"))
if (self instanceof AST_Binary
&& self.right instanceof AST_Binary
&& self.right.operator === self.operator
&& (self.operator === "&&" || self.operator === "||"))
{
self.left = make_node(AST_Binary, self.left, {
operator : self.operator,