Skip to content

Commit

Permalink
refactor(transformer): rename BoundIdentifier::new_uid_in_root_scope (
Browse files Browse the repository at this point in the history
#4902)

Just renaming the method.
  • Loading branch information
overlookmotel committed Aug 14, 2024
1 parent 1e6d0fe commit 452187a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion crates/oxc_transformer/src/helpers/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/react/jsx_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 452187a

Please sign in to comment.