API Reference

IIdentifierOwnerResolver

Contract for resolving which object in the current context owns a given identifier. Implement this interface to add a custom owner-lookup strategy.

Description

Each identifier in an expression (e.g. a in a + b) must be resolved to an owner — the object that holds it. resolve(index, context) returns that owner object, or null to skip to the next resolver in the list.

The default implementation DefaultIdentifierOwnerResolver iterates an ordered list of IIdentifierOwnerResolver instances and returns the first non-null result.

Method

resolve(index, context)

index — The identifier being resolved (typically a property name, numeric index, or map/set key).

context — The object in which the identifier is being looked up. May be undefined when resolving root-level globals.

Returns the owning object if this resolver claims the identifier, or null to defer to the next resolver.