refactor(semantic)!: remove SymbolTable::rename method (#7868)

Remove `SymbolTable::rename` method. We also have `SymbolTable::set_name` method which does the same thing.
This commit is contained in:
overlookmotel 2024-12-14 04:28:50 +00:00
parent 624398083a
commit c0714945b2
2 changed files with 1 additions and 6 deletions

View file

@ -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;

View file

@ -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);
}