fix corner case in merge_vars (#4140)

fixes #4139
This commit is contained in:
Alex Lam S.L
2020-09-21 23:49:41 +01:00
committed by GitHub
2 changed files with 32 additions and 6 deletions

View File

@@ -4413,12 +4413,9 @@ merge(Compressor.prototype, {
if (node instanceof AST_Scope) {
push();
segment.block = node;
if (node instanceof AST_Lambda) {
if (node.name) {
if (node !== self) segment.loop = true;
references[node.name.definition().id] = false;
}
references[node.variables.get("arguments").id] = false;
if (node instanceof AST_Lambda && node.name) {
if (node !== self) segment.loop = true;
references[node.name.definition().id] = false;
}
descend();
pop();
@@ -4538,6 +4535,7 @@ merge(Compressor.prototype, {
}
function mark(sym, read, write) {
if (sym.name == "arguments") return;
var def = sym.definition();
if (def.id in references) {
var refs = references[def.id];