aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-17 16:55:19 +0000
committerGitHub <noreply@github.com>2020-12-18 00:55:19 +0800
commit02fdcfde01cf41cae9449dbde4ceb74564bb35f3 (patch)
treeed03d7d9146ea280332af13f676bc31a1b492186 /lib
parenta96f087ac33b6d18d5ffa3cacd39dd693defb7cf (diff)
downloadtracifyjs-02fdcfde01cf41cae9449dbde4ceb74564bb35f3.tar.gz
tracifyjs-02fdcfde01cf41cae9449dbde4ceb74564bb35f3.zip
fix corner case in `inline` (#4389)
fixes #4388
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/compress.js b/lib/compress.js
index ffc19b25..2c50cb37 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -8026,8 +8026,14 @@ merge(Compressor.prototype, {
}));
if (found) return false;
}
- var safe_to_inject = (!(scope instanceof AST_Toplevel) || compressor.toplevel.vars)
- && (exp !== fn || fn.parent_scope.resolve() === scope);
+ var safe_to_inject = exp !== fn || fn.parent_scope.resolve() === scope;
+ if (scope instanceof AST_Toplevel) {
+ if (compressor.toplevel.vars) {
+ defined["arguments"] = true;
+ } else {
+ safe_to_inject = false;
+ }
+ }
var inline = compressor.option("inline");
var used = Object.create(defined);
if (!can_inject_args(defined, used, inline >= 2 && safe_to_inject)) return false;