fix corner case in collapse_vars (#4875)

fixes #4874
This commit is contained in:
Alex Lam S.L
2021-04-27 01:54:02 +01:00
committed by GitHub
parent 97bd56b7e8
commit 4cccc01f3e
2 changed files with 28 additions and 0 deletions

View File

@@ -1963,6 +1963,7 @@ merge(Compressor.prototype, {
} else if (candidate instanceof AST_VarDef) {
replaced = !compressor.exposed(def) && def.references.length == def.replaced;
}
value_def.last_ref = false;
value_def.single_use = false;
}
if (replaced && !remove_candidate(candidate)) statements.splice(stat_index, 1);