From da29ad04cc3b59103eca2f699ea5373082a29888 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Sat, 20 Jul 2024 00:33:00 +0900 Subject: [PATCH] Optimize `CustomBindingCollector` --- crates/swc_ecma_transforms_base/src/rename/collector.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/swc_ecma_transforms_base/src/rename/collector.rs b/crates/swc_ecma_transforms_base/src/rename/collector.rs index cec0ce8ca17b6..46d1437e6493e 100644 --- a/crates/swc_ecma_transforms_base/src/rename/collector.rs +++ b/crates/swc_ecma_transforms_base/src/rename/collector.rs @@ -135,10 +135,14 @@ where fn visit_expr(&mut self, node: &Expr) { let old = self.is_pat_decl; self.is_pat_decl = false; - maybe_grow_default(|| node.visit_children_with(self)); + node.visit_children_with(self); self.is_pat_decl = old; } + fn visit_bin_expr(&mut self, node: &BinExpr) { + maybe_grow_default(|| node.visit_children_with(self)); + } + fn visit_fn_decl(&mut self, node: &FnDecl) { node.visit_children_with(self);