Trait Renamer
pub trait Renamer: Send + Sync {
const RESET_N: bool;
const MANGLE: bool;
// Required method
fn new_name_for(&self, orig: &(Atom, SyntaxContext), n: &mut usize) -> Atom;
// Provided methods
fn preserved_ids_for_module(
&mut self,
_: &Module,
) -> HashSet<(Atom, SyntaxContext), BuildHasherDefault<FxHasher>> { ... }
fn preserved_ids_for_script(
&mut self,
_: &Script,
) -> HashSet<(Atom, SyntaxContext), BuildHasherDefault<FxHasher>> { ... }
fn get_cached(
&self,
) -> Option<Cow<'_, HashMap<(Atom, SyntaxContext), Atom, BuildHasherDefault<FxHasher>>>> { ... }
fn store_cache(
&mut self,
_update: &HashMap<(Atom, SyntaxContext), Atom, BuildHasherDefault<FxHasher>>,
) { ... }
}
Available on crate feature
__ecma
and (crate features __ecma_transforms
or __testing_transform
) only.Required Associated Constants§
Required Methods§
fn new_name_for(&self, orig: &(Atom, SyntaxContext), n: &mut usize) -> Atom
fn new_name_for(&self, orig: &(Atom, SyntaxContext), n: &mut usize) -> Atom
Should increment n
.
Provided Methods§
fn preserved_ids_for_module( &mut self, _: &Module, ) -> HashSet<(Atom, SyntaxContext), BuildHasherDefault<FxHasher>>
fn preserved_ids_for_script( &mut self, _: &Script, ) -> HashSet<(Atom, SyntaxContext), BuildHasherDefault<FxHasher>>
fn get_cached( &self, ) -> Option<Cow<'_, HashMap<(Atom, SyntaxContext), Atom, BuildHasherDefault<FxHasher>>>>
fn store_cache( &mut self, _update: &HashMap<(Atom, SyntaxContext), Atom, BuildHasherDefault<FxHasher>>, )
Object Safety§
This trait is not object safe.