diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-17 19:10:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-18 03:10:16 +0800 |
commit | ab82be82b28c8fed0643569700d9b5ff2f093aea (patch) | |
tree | b308e582f626519502f3b87fb2d7ab123c466620 /lib | |
parent | 02fdcfde01cf41cae9449dbde4ceb74564bb35f3 (diff) | |
download | tracifyjs-ab82be82b28c8fed0643569700d9b5ff2f093aea.tar.gz tracifyjs-ab82be82b28c8fed0643569700d9b5ff2f093aea.zip |
fix corner case in `collapse_vars` (#4391)
fixes #4390
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js index 2c50cb37..8fe0ad62 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -1776,7 +1776,9 @@ merge(Compressor.prototype, { can_replace = false; var after = stop_after; var if_hit = stop_if_hit; - for (var i = 0; !abort && i < fn.body.length; i++) { + if (fn instanceof AST_Arrow && fn.value) { + fn.value.transform(scanner); + } else for (var i = 0; !abort && i < fn.body.length; i++) { var stat = fn.body[i]; if (stat instanceof AST_Return) { if (stat.value) stat.value.transform(scanner); |