ScopeProvider.AbstractScope findScope(C langContext, Node node, Frame frame)
node. There must be at least one scope provided, that corresponds to the enclosing function. The language might provide additional block scopes, closure scopes, etc. The scope hierarchy should correspond with the scope nesting, from the inner-most to the outer-most. The scopes are expected to contain variables valid at the associated node.
In general, there can be a different list of scopes with different variables and arguments
returned for different
Frame instances, as scopes may depend on runtime information.
Known lexical scopes are returned when
frame argument is
Scope.findScopes(Env, Node, Frame) provides result of this method called on
the implementation of the enclosing
RootNode . When the guest language does not
implement this service, the enclosing
RootNode's scope with variables read from its
FrameSlots is provided by default.
langContext- the language execution context
node- a node to find the enclosing scopes for. The node is inside a
RootNodeassociated with this language.
frame- The current frame the node is in, or
nullfor lexical access when the program is not running, or is not suspended at the node's location.