aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-11 03:34:55 +0800
committerGitHub <noreply@github.com>2017-03-11 03:34:55 +0800
commitd9344f30b83ecdfc8310ff43b9361c67cc85ec3e (patch)
tree0113b3b7703a4abee12b566721e77f695dede971 /lib/compress.js
parentbe80f7e706cd6eb1c5f06e433804fda589a8968a (diff)
downloadtracifyjs-d9344f30b83ecdfc8310ff43b9361c67cc85ec3e.tar.gz
tracifyjs-d9344f30b83ecdfc8310ff43b9361c67cc85ec3e.zip
disallow parameter substitution for named IIFEs (#1596)
Self-referenced function has non-fixed values assigned to its parameters. Let `unused` & `!keep_fnames` do the scanning, then apply `reduce_vars` only to unnamed functions. fixes #1595
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 3964636f..7302f5b9 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -279,6 +279,7 @@ merge(Compressor.prototype, {
}
var iife;
if (node instanceof AST_Function
+ && !node.name
&& (iife = tw.parent()) instanceof AST_Call
&& iife.expression === node) {
// Virtually turn IIFE parameters into variable definitions: