Skip to content

Commit

Permalink
refactor(semantic)!: remove SymbolTable::rename method
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 14, 2024
1 parent ef32f46 commit 0d31b98
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions crates/oxc_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ impl SymbolTable {
}

/// Rename a symbol.
#[inline]
pub fn rename(&mut self, symbol_id: SymbolId, new_name: CompactStr) {
self.names[symbol_id] = new_name;
}

#[inline]
pub fn set_name(&mut self, symbol_id: SymbolId, name: CompactStr) {
self.names[symbol_id] = name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ impl<'a> ArrowFunctionConverter<'a> {
/// Rename the `arguments` symbol to a new name.
fn rename_arguments_symbol(symbol_id: SymbolId, name: CompactStr, ctx: &mut TraverseCtx<'a>) {
let scope_id = ctx.symbols().get_scope_id(symbol_id);
ctx.symbols_mut().rename(symbol_id, name.clone());
ctx.symbols_mut().set_name(symbol_id, name.clone());
ctx.scopes_mut().rename_binding(scope_id, "arguments", name);
}

Expand Down

0 comments on commit 0d31b98

Please sign in to comment.