aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-05-06 16:42:35 +0800
committerGitHub <noreply@github.com>2018-05-06 16:42:35 +0800
commit6b91d12ec352ad0494752aa6a74ee16cc99b5158 (patch)
treeecdfbec52c6c22a934464686abed68f1dbe8fa74 /lib
parentf37b91879f32b6ec9f99bc89350b3767119e3638 (diff)
downloadtracifyjs-6b91d12ec352ad0494752aa6a74ee16cc99b5158.tar.gz
tracifyjs-6b91d12ec352ad0494752aa6a74ee16cc99b5158.zip
fix corner case in `reduce_vars` (#3124)
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/compress.js b/lib/compress.js
index bdce24bc..03fb1c11 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -383,7 +383,15 @@ merge(Compressor.prototype, {
}
function mark_defun(tw, def) {
- if (def.id in tw.defun_ids) return def.fixed;
+ if (def.id in tw.defun_ids) {
+ var marker = tw.defun_ids[def.id];
+ if (!marker) return;
+ if (marker !== tw.safe_ids) {
+ tw.defun_ids[def.id] = undefined;
+ return;
+ }
+ return def.fixed;
+ }
if (!tw.in_loop) {
tw.defun_ids[def.id] = tw.safe_ids;
return def.fixed;