fix corner case in arguments (#4293)

fixes #4291
This commit is contained in:
Alex Lam S.L
2020-11-18 00:54:58 +00:00
committed by GitHub
parent 0bedd031da
commit aff842f2f9
3 changed files with 27 additions and 2 deletions

View File

@@ -9575,7 +9575,8 @@ merge(Compressor.prototype, {
&& expr instanceof AST_SymbolRef
&& is_arguments(def = expr.definition())
&& prop instanceof AST_Number
&& (fn = expr.scope.resolve()) === find_lambda()) {
&& (fn = expr.scope.resolve()) === find_lambda()
&& fn.uses_arguments !== "d") {
var index = prop.value;
if (parent instanceof AST_UnaryPrefix && parent.operator == "delete") {
if (!def.deleted) def.deleted = [];