aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2020-09-22 05:03:06 +0800
committeralexlamsl <alexlamsl@gmail.com>2020-09-22 05:03:06 +0800
commit51803cdcb2a7d4e396b46b38acc1cb70152a3ad8 (patch)
treed9ff61498d18149d8a4be7909e8d9027e6c3bad9 /lib
parent8fa470c17c56d62f971fa71fb1cb99e961b64d8e (diff)
downloadtracifyjs-51803cdcb2a7d4e396b46b38acc1cb70152a3ad8.tar.gz
tracifyjs-51803cdcb2a7d4e396b46b38acc1cb70152a3ad8.zip
fix corner case in `merge_vars`
fixes #4139
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/compress.js b/lib/compress.js
index 82bbbf1b..30a82e35 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -4408,12 +4408,9 @@ merge(Compressor.prototype, {
if (node instanceof AST_Scope) {
push();
segment.block = node;
- if (node instanceof AST_Lambda) {
- if (node.name) {
- if (node !== self) segment.loop = true;
- references[node.name.definition().id] = false;
- }
- references[node.variables.get("arguments").id] = false;
+ if (node instanceof AST_Lambda && node.name) {
+ if (node !== self) segment.loop = true;
+ references[node.name.definition().id] = false;
}
descend();
pop();
@@ -4533,6 +4530,7 @@ merge(Compressor.prototype, {
}
function mark(sym, read, write) {
+ if (sym.name == "arguments") return;
var def = sym.definition();
if (def.id in references) {
var refs = references[def.id];