fix corner case in collapse_vars (#4309)

fixes #4308
This commit is contained in:
Alex Lam S.L
2020-11-19 22:23:37 +00:00
committed by GitHub
parent b18b70f63b
commit 1b579779be
2 changed files with 30 additions and 1 deletions

View File

@@ -1825,7 +1825,11 @@ merge(Compressor.prototype, {
name: sym,
value: arg
}));
if (sym instanceof AST_Destructured) continue;
if (sym instanceof AST_Destructured) {
if (!sym.match_symbol(return_false)) continue;
candidates.length = 0;
break;
}
if (sym.name in names) continue;
names[sym.name] = true;
if (!arg) {