fix corner case reduce_vars (#4300)

fixes #4297
This commit is contained in:
Alex Lam S.L
2020-11-18 17:11:28 +00:00
committed by GitHub
parent f6a83f7944
commit fd6544b340
2 changed files with 20 additions and 0 deletions

View File

@@ -681,6 +681,7 @@ merge(Compressor.prototype, {
&& can_drop_symbol(sym) && safe_to_assign(tw, d)) {
push_ref(d, sym);
mark(tw, d);
if (d.single_use && left instanceof AST_Destructured) d.single_use = false;
tw.loop_ids[d.id] = tw.in_loop;
mark_escaped(tw, d, sym.scope, node, node.right, 0, 1);
sym.fixed = d.fixed = fixed;