Skip to main content

emitted_local_name

Function emitted_local_name 

Source
pub fn emitted_local_name(
    binding: &LocalBinding,
    locals: &[LocalBinding],
) -> Option<String>
Expand description

The JS identifier the emitter declares for binding, or None when it cannot be known from the source alone.

A parameter or pattern binder is always its ts_ident name. A let is too, unless the name is already bound in an enclosing scope (a re-let): the emitter then declares a throwaway __r<N>, numbered by a counter that runs across the whole emitted body, so there is no name to look up and a guess would show another variable’s value.