aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-03-06 18:27:06 +0000
committerGitHub <noreply@github.com>2020-03-06 18:27:06 +0000
commitbdc8ef221802a4da600ff1cdca34e9cc5c5fafc2 (patch)
treef1a12c9a8d5f6439bca36a138ed43a0bf1aabda2 /lib
parentbca52fcba2a99433ce0e30ef7357bd46b676380c (diff)
downloadtracifyjs-bdc8ef221802a4da600ff1cdca34e9cc5c5fafc2.tar.gz
tracifyjs-bdc8ef221802a4da600ff1cdca34e9cc5c5fafc2.zip
fix corner case in `collapse_vars` (#3745)
fixes #3744
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index ab89e927..763aabd8 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -1384,7 +1384,10 @@ merge(Compressor.prototype, {
function is_last_node(node, parent) {
if (node instanceof AST_Call) {
var fn = node.expression;
- if (fn instanceof AST_SymbolRef) fn = fn.fixed_value();
+ if (fn instanceof AST_SymbolRef) {
+ if (fn.definition().recursive_refs > 0) return true;
+ fn = fn.fixed_value();
+ }
if (!(fn instanceof AST_Lambda)) return true;
if (fn.collapse_scanning) return false;
fn.collapse_scanning = true;