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 Detail

      • getSlot

        StaticTypedSlot getSlot​(java.lang.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.
      • getTypeOfThis

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

        @Nullable
        default 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.