enhance reduce_vars (#4479)

This commit is contained in:
Alex Lam S.L
2020-12-29 11:43:12 +00:00
committed by GitHub
parent 10a71c182b
commit 560ccc1221
2 changed files with 23 additions and 2 deletions

View File

@@ -771,8 +771,7 @@ merge(Compressor.prototype, {
}
var d = sym.definition();
d.assignments++;
if (!is_modified(compressor, tw, node, node.right, 0)
&& can_drop_symbol(sym) && safe_to_assign(tw, d)) {
if (!is_modified(compressor, tw, node, node.right, 0) && safe_to_assign(tw, d)) {
push_ref(d, sym);
mark(tw, d);
if (d.single_use && left instanceof AST_Destructured) d.single_use = false;