aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2013-12-10 19:39:03 +0200
committerMihai Bazon <mihai@bazon.net>2013-12-10 19:39:03 +0200
commitdf8c5623af1afff5fffc6af49ceda5da16f95d54 (patch)
tree15ae8504308b1e09ed1cd2035b82fe406007fea2
parenta790c09c91d6b334bbe961558a064f33416eb752 (diff)
downloadtracifyjs-df8c5623af1afff5fffc6af49ceda5da16f95d54.tar.gz
tracifyjs-df8c5623af1afff5fffc6af49ceda5da16f95d54.zip
minor
-rw-r--r--lib/compress.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 95dd64d6..4c52f4dd 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1811,9 +1811,15 @@ merge(Compressor.prototype, {
}
if (compressor.option("cascade")) {
if (self.car instanceof AST_Assign
- && !self.car.left.has_side_effects(compressor)
- && self.car.left.equivalent_to(self.cdr)) {
- return self.car;
+ && !self.car.left.has_side_effects(compressor)) {
+ if (self.car.left.equivalent_to(self.cdr)) {
+ return self.car;
+ }
+ if (self.cdr instanceof AST_Call
+ && self.cdr.expression.equivalent_to(self.car.left)) {
+ self.cdr.expression = self.car;
+ return self.cdr;
+ }
}
if (!self.car.has_side_effects(compressor)
&& !self.cdr.has_side_effects(compressor)