fix corner case in pure_getters (#4615)

fixes #4614
This commit is contained in:
Alex Lam S.L
2021-02-05 01:03:51 +00:00
committed by GitHub
parent da24dfb59e
commit 739fa266f8
2 changed files with 30 additions and 1 deletions

View File

@@ -3441,7 +3441,7 @@ merge(Compressor.prototype, {
if (is_undeclared_ref(this) && this.is_declared(compressor)) return false;
if (this.is_immutable()) return false;
var def = this.definition();
if (is_arguments(def) && all(def.scope.argnames, function(argname) {
if (is_arguments(def) && !def.scope.rest && all(def.scope.argnames, function(argname) {
return argname instanceof AST_SymbolFunarg;
})) return def.scope.uses_arguments > 2;
var fixed = this.fixed_value();