aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 08abde9b..1e33dc10 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -797,8 +797,12 @@ merge(Compressor.prototype, {
d.recursive_refs++;
} else if (value && ref_once(tw, compressor, d)) {
d.in_loop = tw.loop_ids[d.id] !== tw.in_loop;
- d.single_use = value instanceof AST_Lambda && !value.pinned()
- || !d.in_loop && d.scope === this.scope && value.is_constant_expression();
+ d.single_use = value instanceof AST_Lambda
+ && !value.pinned()
+ && (!d.in_loop || tw.parent() instanceof AST_Call)
+ || !d.in_loop
+ && d.scope === this.scope
+ && value.is_constant_expression();
} else {
d.single_use = false;
}