aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-24 22:09:19 +0800
committerGitHub <noreply@github.com>2017-03-24 22:09:19 +0800
commit32283a0def807e0a382d4a6a23cc42e99084e1dd (patch)
tree9f5663a80419d4438b2474a2e5af48fc86d4b550 /lib
parentac51d4c5a079dccbc9a6cf69d06f757432c69694 (diff)
downloadtracifyjs-32283a0def807e0a382d4a6a23cc42e99084e1dd.tar.gz
tracifyjs-32283a0def807e0a382d4a6a23cc42e99084e1dd.zip
fix cascade of `evaluate` optimisation (#1654)
Operator has changed, so break out from rest of the rules. fixes #1649
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3804a932..e13985ee 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3292,6 +3292,7 @@ merge(Compressor.prototype, {
left: self.left,
right: self.right.expression
});
+ break;
}
// -a + b => b - a
if (self.left instanceof AST_UnaryPrefix
@@ -3303,6 +3304,7 @@ merge(Compressor.prototype, {
left: self.right,
right: self.left.expression
});
+ break;
}
case "*":
associative = compressor.option("unsafe_math");