From 452187a3ca18ae8b5577f1e562ee7ae3b8b809d1 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:37:25 +0000 Subject: [PATCH] refactor(transformer): rename `BoundIdentifier::new_uid_in_root_scope` (#4902) Just renaming the method. --- crates/oxc_transformer/src/helpers/bindings.rs | 6 +++++- crates/oxc_transformer/src/react/jsx_source.rs | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/oxc_transformer/src/helpers/bindings.rs b/crates/oxc_transformer/src/helpers/bindings.rs index 1cfc8939696b3..ec93386db0ee8 100644 --- a/crates/oxc_transformer/src/helpers/bindings.rs +++ b/crates/oxc_transformer/src/helpers/bindings.rs @@ -56,7 +56,11 @@ impl<'a> BoundIdentifier<'a> { } /// Create `BoundIdentifier` for new binding in root scope - pub fn new_root_uid(name: &str, flags: SymbolFlags, ctx: &mut TraverseCtx<'a>) -> Self { + pub fn new_uid_in_root_scope( + name: &str, + flags: SymbolFlags, + ctx: &mut TraverseCtx<'a>, + ) -> Self { let scope_id = ctx.scopes().root_scope_id(); Self::new_uid(name, scope_id, flags, ctx) } diff --git a/crates/oxc_transformer/src/react/jsx_source.rs b/crates/oxc_transformer/src/react/jsx_source.rs index 234dcc0ad57e2..9a6d23b4f054e 100644 --- a/crates/oxc_transformer/src/react/jsx_source.rs +++ b/crates/oxc_transformer/src/react/jsx_source.rs @@ -169,7 +169,7 @@ impl<'a> ReactJsxSource<'a> { fn get_filename_var(&mut self, ctx: &mut TraverseCtx<'a>) -> BoundIdentifier<'a> { if self.filename_var.is_none() { - self.filename_var = Some(BoundIdentifier::new_root_uid( + self.filename_var = Some(BoundIdentifier::new_uid_in_root_scope( FILE_NAME_VAR, SymbolFlags::FunctionScopedVariable, ctx,