From e84144adb0d2a2ea99755951779d9b3ebfbe5583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Wed, 5 Jul 2023 12:58:41 +0900 Subject: [PATCH] Real fix --- .../swc_ecma_transforms_base/src/rename/mod.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/crates/swc_ecma_transforms_base/src/rename/mod.rs b/crates/swc_ecma_transforms_base/src/rename/mod.rs index 80cb735b0d223..99af2281e23c4 100644 --- a/crates/swc_ecma_transforms_base/src/rename/mod.rs +++ b/crates/swc_ecma_transforms_base/src/rename/mod.rs @@ -243,15 +243,13 @@ where self.unresolved = self.get_unresolved(m, has_eval); + let map = self.get_map(m, false, true, has_eval); + if has_eval { m.visit_mut_children_with(self); } - { - let map = self.get_map(m, false, true, has_eval); - - m.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); - } + m.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); } fn visit_mut_script(&mut self, m: &mut Script) { @@ -261,15 +259,13 @@ where self.unresolved = self.get_unresolved(m, has_eval); + let map = self.get_map(m, false, true, has_eval); + if has_eval { m.visit_mut_children_with(self); } - { - let map = self.get_map(m, false, true, has_eval); - - m.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); - } + m.visit_mut_with(&mut rename_with_config(&map, self.config.clone())); } }