aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-11-28 19:48:42 +0000
committerGitHub <noreply@github.com>2020-11-29 03:48:42 +0800
commit8791f258e3996adb882fc62329f970270366b216 (patch)
tree57a156966639877ac193ed709522db3291aaa5b9 /lib
parentaf1cca25bf3c29aa925bbe2a164786ebcf7dd476 (diff)
downloadtracifyjs-8791f258e3996adb882fc62329f970270366b216.tar.gz
tracifyjs-8791f258e3996adb882fc62329f970270366b216.zip
fix corner case in `inline` (#4322)
fixes #4321
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 1d729096..7759ff11 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4609,12 +4609,13 @@ merge(Compressor.prototype, {
var len = fn.argnames.length;
if (len > 0 && compressor.option("inline") < 2) break;
if (len > self.argnames.length) break;
+ if (!all(self.argnames, function(argname) {
+ return argname instanceof AST_SymbolFunarg;
+ })) break;
for (var j = 0; j < len; j++) {
var arg = call.args[j];
if (!(arg instanceof AST_SymbolRef)) break;
- var argname = self.argnames[j];
- if (!(argname instanceof AST_SymbolFunarg)) break;
- if (arg.definition() !== argname.definition()) break;
+ if (arg.definition() !== self.argnames[j].definition()) break;
}
if (j < len) break;
for (; j < call.args.length; j++) {