Interface StaticTypedScope

All Superinterfaces:
StaticScope
All Known Subinterfaces:
FlowScope
All Known Implementing Classes:
TypedScope

public interface StaticTypedScope extends StaticScope
The StaticTypedScope 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.
  • Method Details

    • getParentScope

      StaticTypedScope getParentScope()
      Returns the scope enclosing this one or null if none.
      Specified by:
      getParentScope in interface StaticScope
    • getSlot

      StaticTypedSlot getSlot(String name)
      Returns any defined slot within this scope for this name. This call continues searching through parent scopes if a slot with this name is not found in the current scope.
      Specified by:
      getSlot in interface StaticScope
      Parameters:
      name - The name of the variable slot to look up.
      Returns:
      The defined slot for the variable, or null if no definition exists.
    • getOwnSlot

      StaticTypedSlot getOwnSlot(String name)
      Like getSlot but does not recurse into parent scopes.
      Specified by:
      getOwnSlot in interface StaticScope
    • getTypeOfThis

      JSType getTypeOfThis()
      Returns the expected type of this in the current scope.
    • lookupQualifiedName

      default @Nullable JSType lookupQualifiedName(QualifiedName qname)
      Looks up a given qualified name in the scope. if that fails, looks up the component properties off of any owner types that are in scope.

      This is always more or equally expensive as calling getSlot(String name), so should only be used when necessary.

      This only returns declared qualified names and known properties. It returns null given an inferred name.