diff --git a/crates/oxc_traverse/src/context/mod.rs b/crates/oxc_traverse/src/context/mod.rs index 2ed8df9795d870..e629a442fa3b1f 100644 --- a/crates/oxc_traverse/src/context/mod.rs +++ b/crates/oxc_traverse/src/context/mod.rs @@ -380,7 +380,11 @@ impl<'a> TraverseCtx<'a> { self.scoping.create_reference_in_current_scope(name, flag) } - /// Clone IdentifierReference based on the original reference's SymbolId and name. + /// Clone `IdentifierReference` based on the original reference's `SymbolId` and name. + /// + /// This method makes a lookup of the `SymbolId` for the reference. If you need to create multiple + /// `IdentifierReference`s for the same binding, it is better to look up the `SymbolId` only once, + /// and generate `IdentifierReference`s with `TraverseCtx::create_reference_id`. /// /// This is a shortcut for `ctx.scoping.clone_identifier_reference`. pub fn clone_identifier_reference( diff --git a/crates/oxc_traverse/src/context/scoping.rs b/crates/oxc_traverse/src/context/scoping.rs index 32f217895d94b9..b4ecbfe2a4f99e 100644 --- a/crates/oxc_traverse/src/context/scoping.rs +++ b/crates/oxc_traverse/src/context/scoping.rs @@ -331,7 +331,7 @@ impl TraverseScoping { /// /// This method makes a lookup of the `SymbolId` for the reference. If you need to create multiple /// `IdentifierReference`s for the same binding, it is better to look up the `SymbolId` only once, - /// and generate `IdentifierReference`s with `TraverseCtx::create_reference_id`. + /// and generate `IdentifierReference`s with `TraverseScoping::create_reference_id`. pub fn clone_identifier_reference<'a>( &mut self, ident: &IdentifierReference<'a>,