aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-03-21 02:58:33 +0800
committerGitHub <noreply@github.com>2019-03-21 02:58:33 +0800
commit54b0b49b6810ab77a733da6a88133ad47940c9d9 (patch)
tree7378c6cd38d8258e7ac6170bd8e8b4e94ab665c7 /lib/compress.js
parent65648d84a5f1df20e6a839cde9fc9dcabc7e13ea (diff)
downloadtracifyjs-54b0b49b6810ab77a733da6a88133ad47940c9d9.tar.gz
tracifyjs-54b0b49b6810ab77a733da6a88133ad47940c9d9.zip
enhance `inline` (#3352)
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 778d7fa9..fe6e72d1 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -5072,7 +5072,7 @@ merge(Compressor.prototype, {
}
} while (!(scope instanceof AST_Scope));
var safe_to_inject = (!(scope instanceof AST_Toplevel) || compressor.toplevel.vars)
- && fn.parent_scope === compressor.find_parent(AST_Scope);
+ && (exp !== fn || fn.parent_scope === compressor.find_parent(AST_Scope));
var inline = compressor.option("inline");
if (!can_inject_vars(catches, inline >= 3 && safe_to_inject)) return false;
if (!can_inject_args(catches, inline >= 2 && safe_to_inject)) return false;