@@ -1907,8 +1907,12 @@ merge(Compressor.prototype, {
|
|||||||
// if right is a constant, whatever side effects the
|
// if right is a constant, whatever side effects the
|
||||||
// left side might have could not influence the
|
// left side might have could not influence the
|
||||||
// result. hence, force switch.
|
// result. hence, force switch.
|
||||||
|
|
||||||
|
if (!(self.left instanceof AST_Binary
|
||||||
|
&& PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {
|
||||||
reverse(null, true);
|
reverse(null, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (/^[!=]==?$/.test(self.operator)) {
|
if (/^[!=]==?$/.test(self.operator)) {
|
||||||
if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {
|
if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {
|
||||||
if (self.right.consequent instanceof AST_SymbolRef
|
if (self.right.consequent instanceof AST_SymbolRef
|
||||||
|
|||||||
11
test/compress/issue-267.js
Normal file
11
test/compress/issue-267.js
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
issue_267: {
|
||||||
|
options = { comparisons: true };
|
||||||
|
input: {
|
||||||
|
x = a % b / b * c * 2;
|
||||||
|
x = a % b * 2
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
x = a % b / b * c * 2;
|
||||||
|
x = a % b * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user