Fix regression after e4c5302406
`x * (y * z)` ==> `x * y * z` -- the better place to do this is in the compressor rather than codegen.
This commit is contained in:
@@ -2089,6 +2089,19 @@ merge(Compressor.prototype, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// x * (y * z) ==> x * y * z
|
||||||
|
if (self.right instanceof AST_Binary
|
||||||
|
&& self.right.operator == self.operator
|
||||||
|
&& (self.operator == "*" || self.operator == "&&" || self.operator == "||"))
|
||||||
|
{
|
||||||
|
self.left = make_node(AST_Binary, self.left, {
|
||||||
|
operator : self.operator,
|
||||||
|
left : self.left,
|
||||||
|
right : self.right.left
|
||||||
|
});
|
||||||
|
self.right = self.right.right;
|
||||||
|
return self.transform(compressor);
|
||||||
|
}
|
||||||
return self.evaluate(compressor)[0];
|
return self.evaluate(compressor)[0];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user