fix corner case in arguments (#5007)

fixes #5006
This commit is contained in:
Alex Lam S.L
2021-06-15 05:53:22 +01:00
committed by GitHub
parent 498ac83541
commit ac1262dc97
2 changed files with 25 additions and 1 deletions

View File

@@ -11717,7 +11717,11 @@ merge(Compressor.prototype, {
} else if (compressor.has_directive("use strict")
|| fn.name
|| fn.rest
|| !(fn_parent instanceof AST_Call && index < fn_parent.args.length)
|| !(fn_parent instanceof AST_Call
&& index < fn_parent.args.length
&& all(fn_parent.args.slice(0, index + 1), function(arg) {
return !(arg instanceof AST_Spread);
}))
|| !all(fn.argnames, function(argname) {
return argname instanceof AST_SymbolFunarg;
})) {