aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-31 06:55:05 +0000
committerGitHub <noreply@github.com>2020-12-31 14:55:05 +0800
commit0b7d65d33197e2cab4e57009c1bc5f6fd590b702 (patch)
treebac3e9e84f144bc1bd80ee1c81ae4c10bc595c20 /lib
parent8b954b022bf206048f8380878251bd64795da5f9 (diff)
downloadtracifyjs-0b7d65d33197e2cab4e57009c1bc5f6fd590b702.tar.gz
tracifyjs-0b7d65d33197e2cab4e57009c1bc5f6fd590b702.zip
fix corner case with `arguments` (#4486)
fixes #4485
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index aea3155a..531c9aad 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -3344,7 +3344,9 @@ 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)) return def.scope.uses_arguments > 2;
+ if (is_arguments(def) && all(def.scope.argnames, function(argname) {
+ return argname instanceof AST_SymbolFunarg;
+ })) return def.scope.uses_arguments > 2;
var fixed = this.fixed_value();
if (!fixed) return true;
this._dot_throw = return_true;