fix corner case in collapse_vars (#4048)

fixes #4047
This commit is contained in:
Alex Lam S.L
2020-08-09 22:48:56 +01:00
committed by GitHub
parent e2237d8cd2
commit 49670d216b
2 changed files with 62 additions and 3 deletions

View File

@@ -1984,9 +1984,12 @@ merge(Compressor.prototype, {
if (expr.name instanceof AST_SymbolFunarg) {
var index = compressor.self().argnames.indexOf(expr.name);
var args = compressor.parent().args;
if (args[index]) args[index] = make_node(AST_Number, args[index], {
value: 0
});
if (args[index]) {
args[index] = make_node(AST_Number, args[index], {
value: 0
});
expr.name.definition().fixed = false;
}
return true;
}
var end = hit_stack.length - 1;