diff options
Diffstat (limited to 'lib/compress.js')
-rw-r--r-- | lib/compress.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 4166909f..96ed24a5 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -334,6 +334,11 @@ merge(Compressor.prototype, { if (node instanceof AST_SymbolRef) { var d = node.definition(); d.references.push(node); + if (d.references.length == 1 + && !d.fixed + && d.orig[0] instanceof AST_SymbolDefun) { + loop_ids[d.id] = in_loop; + } var value; if (d.fixed === undefined || !safe_to_read(d) || d.single_use == "m") { d.fixed = false; @@ -402,9 +407,9 @@ merge(Compressor.prototype, { d.fixed = false; } else { d.fixed = node; + d.single_use = ref_once(d); loop_ids[d.id] = in_loop; mark(d, true); - d.single_use = ref_once(d); } var save_ids = safe_ids; safe_ids = Object.create(null); |