public interface StaticScope
StaticScope
interface must be implemented by any object that
defines variables for the purposes of static analysis. It is distinguished
from the Scriptable
class that Rhino normally uses to represent a
run-time scope.Modifier and Type | Method and Description |
---|---|
StaticSlot |
getOwnSlot(java.lang.String name)
Like
getSlot but does not recurse into parent scopes. |
StaticScope |
getParentScope()
Returns the scope enclosing this one or null if none.
|
Node |
getRootNode()
Returns the root node associated with this scope.
|
StaticSlot |
getSlot(java.lang.String name)
Returns any defined slot within this scope for this name.
|
default StaticScope |
getTopmostScopeOfEventualDeclaration(java.lang.String name)
Returns the topmost slot containing this name, or null if no slots do.
|
Node getRootNode()
StaticScope getParentScope()
StaticSlot getSlot(java.lang.String name)
name
- The name of the variable slot to look up.null
if no
definition exists.StaticSlot getOwnSlot(java.lang.String name)
getSlot
but does not recurse into parent scopes.default StaticScope getTopmostScopeOfEventualDeclaration(java.lang.String name)
getSlot(java.lang.String)
returns null, though. Do not rely on this method if you need an actual
slot.
This method is intended for use while scopes are still being built, hence the name 'eventual' declaration. Once scope building is complete, the scope returned from this method must be equivalent to "getSlot(name).getScope()" or null
Copyright © 2009-2020 Google. All Rights Reserved.