aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-07-31 01:05:09 +0100
committerGitHub <noreply@github.com>2020-07-31 08:05:09 +0800
commitee632a5519078ac3fe97d0864731bea4bdad9365 (patch)
treee6b8469bcec072d98849c2dca8ce3545011db2db /lib/compress.js
parentdfe47bcc42d0385577ecffa7fe312025e1369e7b (diff)
downloadtracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.tar.gz
tracifyjs-ee632a5519078ac3fe97d0864731bea4bdad9365.zip
fix corner case in `reduce_vars` (#4031)
fixes #4030
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index d439ed4c..792d5ab2 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -587,7 +587,10 @@ merge(Compressor.prototype, {
d.assignments++;
var fixed = d.fixed;
var value = eq ? node.right : node;
- if (is_modified(compressor, tw, node, value, 0)) return;
+ if (is_modified(compressor, tw, node, value, 0)) {
+ d.fixed = false;
+ return;
+ }
var safe = eq || safe_to_read(tw, d);
node.right.walk(tw);
if (safe && safe_to_assign(tw, d)) {