aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-11-17 11:19:42 +0800
committerGitHub <noreply@github.com>2019-11-17 11:19:42 +0800
commit8504a4ea0eddeb759f6f762f4ee46e5dde5f8e07 (patch)
tree62ae9871704fc0600b1c89323275ce809da93917 /lib
parent10c1a78772c1d6ca1bc7f78f0fa1f2ab50b07ae2 (diff)
downloadtracifyjs-8504a4ea0eddeb759f6f762f4ee46e5dde5f8e07.tar.gz
tracifyjs-8504a4ea0eddeb759f6f762f4ee46e5dde5f8e07.zip
fix corner case in `reduce_funcs` (#3592)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 801cbaea..45db019b 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -5369,6 +5369,7 @@ merge(Compressor.prototype, {
&& !fn.contains_this()
&& can_inject_symbols()) {
fn._squeezed = true;
+ if (exp !== fn) fn.parent_scope = exp.scope;
return make_sequence(self, flatten_fn()).optimize(compressor);
}
if (compressor.option("side_effects")
@@ -6382,6 +6383,7 @@ merge(Compressor.prototype, {
} while (scope = scope.parent_scope);
}
}
+ if (single_use) fixed.parent_scope = self.scope;
}
if (single_use && fixed) {
def.single_use = false;