diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index f7fedeb2..7202219a 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -3738,7 +3738,7 @@ merge(Compressor.prototype, { head.push(def); } else { var value = def.value - && (sym.references.length != 1 || !sym.replaced) + && !def.value.single_use && def.value.drop_side_effect_free(compressor); if (value) { AST_Node.warn("Side effects in initialization of unused variable {name} [{file}:{line},{col}]", template(def.name)); @@ -6158,6 +6158,7 @@ merge(Compressor.prototype, { if (single_use && fixed) { def.single_use = false; fixed._squeezed = true; + fixed.single_use = true; if (fixed instanceof AST_Defun) { fixed = make_node(AST_Function, fixed, fixed); fixed.name = make_node(AST_SymbolLambda, fixed.name, fixed.name); |