From df8c5623af1afff5fffc6af49ceda5da16f95d54 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Tue, 10 Dec 2013 19:39:03 +0200 Subject: minor --- lib/compress.js | 12 +++++++++--- 1 file 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) -- cgit v1.2.3