aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 66441e80..5a1df7c3 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1818,10 +1818,7 @@ merge(Compressor.prototype, {
return node;
}
if (is_lhs(node, parent)) {
- if (value_def && !hit_rhs) {
- assign_used = true;
- if (node.definition().last_ref === node) replaced++;
- }
+ if (value_def && !hit_rhs) assign_used = true;
return node;
} else if (value_def) {
if (stop_if_hit && assign_pos == 0) assign_pos = remaining - replaced;
@@ -2024,7 +2021,7 @@ merge(Compressor.prototype, {
statements[i].transform(scanner);
}
if (value_def) {
- if (!replaced || remaining > replaced) {
+ if (!replaced || remaining > replaced + assign_used) {
candidates.push(hit_stack);
force_single = true;
continue;