@@ -7,7 +7,7 @@ use rustc_hash::FxHashSet;
77#[ allow( clippy:: wildcard_imports) ]
88use oxc_ast:: { ast:: * , visit:: Visit } ;
99use oxc_semantic:: { NodeId , Reference , ScopeTree , SymbolTable } ;
10- use oxc_span:: { Atom , CompactStr , Span } ;
10+ use oxc_span:: CompactStr ;
1111use oxc_syntax:: {
1212 reference:: { ReferenceFlags , ReferenceId } ,
1313 scope:: { ScopeFlags , ScopeId } ,
@@ -266,18 +266,6 @@ impl TraverseScoping {
266266 reference_id
267267 }
268268
269- /// Create an `IdentifierReference` bound to a `SymbolId`
270- pub fn create_bound_reference_id < ' a > (
271- & mut self ,
272- span : Span ,
273- name : Atom < ' a > ,
274- symbol_id : SymbolId ,
275- flags : ReferenceFlags ,
276- ) -> IdentifierReference < ' a > {
277- let reference_id = self . create_bound_reference ( symbol_id, flags) ;
278- IdentifierReference :: new_with_reference_id ( span, name, Some ( reference_id) )
279- }
280-
281269 /// Create an unbound reference
282270 pub fn create_unbound_reference (
283271 & mut self ,
@@ -290,17 +278,6 @@ impl TraverseScoping {
290278 reference_id
291279 }
292280
293- /// Create an unbound `IdentifierReference`
294- pub fn create_unbound_reference_id < ' a > (
295- & mut self ,
296- span : Span ,
297- name : Atom < ' a > ,
298- flags : ReferenceFlags ,
299- ) -> IdentifierReference < ' a > {
300- let reference_id = self . create_unbound_reference ( name. to_compact_str ( ) , flags) ;
301- IdentifierReference :: new_with_reference_id ( span, name, Some ( reference_id) )
302- }
303-
304281 /// Create a reference optionally bound to a `SymbolId`.
305282 ///
306283 /// If you know if there's a `SymbolId` or not, prefer `TraverseCtx::create_bound_reference`
@@ -318,24 +295,6 @@ impl TraverseScoping {
318295 }
319296 }
320297
321- /// Create an `IdentifierReference` optionally bound to a `SymbolId`.
322- ///
323- /// If you know if there's a `SymbolId` or not, prefer `TraverseCtx::create_bound_reference_id`
324- /// or `TraverseCtx::create_unbound_reference_id`.
325- pub fn create_reference_id < ' a > (
326- & mut self ,
327- span : Span ,
328- name : Atom < ' a > ,
329- symbol_id : Option < SymbolId > ,
330- flags : ReferenceFlags ,
331- ) -> IdentifierReference < ' a > {
332- if let Some ( symbol_id) = symbol_id {
333- self . create_bound_reference_id ( span, name, symbol_id, flags)
334- } else {
335- self . create_unbound_reference_id ( span, name, flags)
336- }
337- }
338-
339298 /// Create reference in current scope, looking up binding for `name`
340299 pub fn create_reference_in_current_scope (
341300 & mut self ,
@@ -365,24 +324,6 @@ impl TraverseScoping {
365324 self . delete_reference ( ident. reference_id ( ) . unwrap ( ) , & ident. name ) ;
366325 }
367326
368- /// Clone `IdentifierReference` based on the original reference's `SymbolId` and name.
369- ///
370- /// This method makes a lookup of the `SymbolId` for the reference. If you need to create multiple
371- /// `IdentifierReference`s for the same binding, it is better to look up the `SymbolId` only once,
372- /// and generate `IdentifierReference`s with `TraverseScoping::create_reference_id`.
373- pub fn clone_identifier_reference < ' a > (
374- & mut self ,
375- ident : & IdentifierReference < ' a > ,
376- flags : ReferenceFlags ,
377- ) -> IdentifierReference < ' a > {
378- let reference =
379- self . symbols ( ) . get_reference ( ident. reference_id . get ( ) . unwrap_or_else ( || {
380- unreachable ! ( "IdentifierReference must have a reference_id" ) ;
381- } ) ) ;
382- let symbol_id = reference. symbol_id ( ) ;
383- self . create_reference_id ( ident. span , ident. name . clone ( ) , symbol_id, flags)
384- }
385-
386327 /// Determine whether evaluating the specific input `node` is a consequenceless reference.
387328 ///
388329 /// I.E evaluating it won't result in potentially arbitrary code from being ran. The following are
0 commit comments