Struct js_source_scopes::NameResolver
source · pub struct NameResolver<'a, T> { /* private fields */ }
Expand description
A structure for resolving ScopeName
s in minified code to their original names
using information contained in a DecodedMap
.
Implementations§
source§impl<'a, T: AsRef<str>> NameResolver<'a, T>
impl<'a, T: AsRef<str>> NameResolver<'a, T>
sourcepub fn new(ctx: &'a SourceContext<T>, sourcemap: &'a DecodedMap) -> Self
pub fn new(ctx: &'a SourceContext<T>, sourcemap: &'a DecodedMap) -> Self
Construct a new NameResolver
from a SourceContext
(for the minified source) and a DecodedMap
.
sourcepub fn resolve_name(&self, name: &ScopeName) -> String
pub fn resolve_name(&self, name: &ScopeName) -> String
Resolves the given minified ScopeName
to the original name.
This tries to resolve each NameComponent
by looking up its source
range in the DecodedMap
, using the token’s name
(as defined in the
sourcemap names
) when possible.