fix corner case in collapse_vars (#4243)

fixes #4242
This commit is contained in:
Alex Lam S.L
2020-10-24 15:44:20 +01:00
committed by GitHub
parent c5df8355ba
commit e478da24c7
2 changed files with 22 additions and 0 deletions

View File

@@ -1974,6 +1974,7 @@ merge(Compressor.prototype, {
}
function foldable(expr) {
if (expr instanceof AST_Assign && expr.right.single_use) return;
var lhs_ids = Object.create(null);
var marker = new TreeWalker(function(node) {
if (node instanceof AST_SymbolRef) lhs_ids[node.definition().id] = true;