Skip to main content

find_context_identifiers

Function find_context_identifiers 

Source
pub fn find_context_identifiers(
    func: &FunctionNode<'_>,
    scope_info: &ScopeInfo,
    env: &mut Environment,
    identifier_locs: &IdentifierLocIndex,
) -> Result<HashSet<BindingId>, CompilerError>
Expand description

Find context identifiers for a function: variables that are captured across function boundaries and need StoreContext/LoadContext semantics.

A binding is a context identifier if:

  • It is reassigned from inside a nested function (reassignedByInnerFn), OR
  • It is reassigned AND referenced from inside a nested function (reassigned && referencedByInnerFn)

This is the Rust equivalent of the TypeScript FindContextIdentifiers pass.