aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 13ae7c70..108a4e9e 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1907,7 +1907,11 @@ merge(Compressor.prototype, {
// if right is a constant, whatever side effects the
// left side might have could not influence the
// result. hence, force switch.
- reverse(null, true);
+
+ if (!(self.left instanceof AST_Binary
+ && PRECEDENCE[self.left.operator] >= PRECEDENCE[self.operator])) {
+ reverse(null, true);
+ }
}
if (/^[!=]==?$/.test(self.operator)) {
if (self.left instanceof AST_SymbolRef && self.right instanceof AST_Conditional) {