make sure expression is AST_Binary
This commit is contained in:
parent
5c7705fcad
commit
1aade735d0
|
|
@ -2592,9 +2592,10 @@ merge(Compressor.prototype, {
|
||||||
}
|
}
|
||||||
// x && (y && z) ==> x && y && z
|
// 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 instanceof AST_Binary
|
||||||
&& self.right.operator == self.operator
|
&& self.right instanceof AST_Binary
|
||||||
&& (self.operator == "&&" || self.operator == "||"))
|
&& self.right.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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user