From 18c63ff3d806439bfb4df613156563ec050e12e9 Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Mon, 13 Apr 2015 17:29:48 +0300 Subject: Fix compression of conditionals Don't move the condition on the right side of an assignment when the left side may have side effects. Fix #677 --- lib/compress.js | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/compress.js') diff --git a/lib/compress.js b/lib/compress.js index 41e4f17f..fa89c322 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -2343,6 +2343,7 @@ merge(Compressor.prototype, { && alternative instanceof AST_Assign && consequent.operator == alternative.operator && consequent.left.equivalent_to(alternative.left) + && !consequent.left.has_side_effects(compressor) ) { /* * Stuff like this: -- cgit v1.2.3