Class AbstractVar<S extends AbstractScope<S,V>,V extends AbstractVar<S,V>>

java.lang.Object
com.google.javascript.jscomp.AbstractVar<S,V>
All Implemented Interfaces:
StaticRef, StaticSlot, Serializable
Direct Known Subclasses:
TypedVar, Var

public class AbstractVar<S extends AbstractScope<S,V>,V extends AbstractVar<S,V>> extends Object implements StaticSlot, StaticRef
Used by Scope to store information about variables.
See Also:
  • Method Details

    • getName

      public final String getName()
      Description copied from interface: StaticSlot
      Gets the name of the slot.
      Specified by:
      getName in interface StaticSlot
    • getScopeRoot

      public final Node getScopeRoot()
    • getNode

      public final Node getNode()
      Description copied from interface: StaticRef
      The node where the reference lives.
      Specified by:
      getNode in interface StaticRef
    • getSourceFile

      public final StaticSourceFile getSourceFile()
      Description copied from interface: StaticRef
      The source file where the reference lives.
      Specified by:
      getSourceFile in interface StaticRef
    • getSymbol

      public final V getSymbol()
      Description copied from interface: StaticRef
      The variable that this reference points to.
      Specified by:
      getSymbol in interface StaticRef
    • getDeclaration

      public final V getDeclaration()
      Description copied from interface: StaticSlot
      Gets the declaration of this symbol. May not exist.
      Specified by:
      getDeclaration in interface StaticSlot
    • getParentNode

      public final @Nullable Node getParentNode()
    • isBleedingFunction

      public boolean isBleedingFunction()
      Whether this is a bleeding function (an anonymous named function that bleeds into the inner scope).
    • getScope

      public final S getScope()
      Specified by:
      getScope in interface StaticSlot
    • isGlobal

      public final boolean isGlobal()
    • isLocal

      public final boolean isLocal()
    • isDeclaredOrInferredConst

      public final boolean isDeclaredOrInferredConst()
      Returns true if the variable is declared or inferred to be a constant.
    • isDefine

      public final boolean isDefine()
      Returns true if the variable is declared as a define. A variable is a define if it is annotated by @define.
    • getInitialValue

      public final @Nullable Node getInitialValue()
    • getNameNode

      public final Node getNameNode()
    • getJSDocInfo

      public final @Nullable JSDocInfo getJSDocInfo()
      Description copied from interface: StaticSlot
      Gets the JSDoc for this slot.
      Specified by:
      getJSDocInfo in interface StaticSlot
    • isDefaultParam

      public final boolean isDefaultParam()
    • isArguments

      public final boolean isArguments()
    • isThis

      public final boolean isThis()
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object