fix corner case in pure_getters (#4441)

fixes #4440
This commit is contained in:
Alex Lam S.L
2020-12-23 20:09:09 +00:00
committed by GitHub
parent 7e575e9d7f
commit 56fce2131c
2 changed files with 31 additions and 1 deletions

View File

@@ -3237,7 +3237,8 @@ merge(Compressor.prototype, {
if (!is_strict(compressor)) return false;
if (is_undeclared_ref(this) && this.is_declared(compressor)) return false;
if (this.is_immutable()) return false;
if (is_arguments(this.definition())) return false;
var def = this.definition();
if (is_arguments(def)) return def.scope.uses_arguments > 2;
var fixed = this.fixed_value();
if (!fixed) return true;
this._dot_throw = return_true;