Package com.google.javascript.jscomp
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
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 Summary
Modifier and TypeMethodDescriptionfinal boolean
final V
Gets the declaration of this symbol.final @Nullable Node
final @Nullable JSDocInfo
Gets the JSDoc for this slot.final String
getName()
Gets the name of the slot.final Node
final Node
getNode()
The node where the reference lives.final @Nullable Node
final S
getScope()
final Node
final StaticSourceFile
The source file where the reference lives.final V
The variable that this reference points to.final int
hashCode()
final boolean
boolean
Whether this is a bleeding function (an anonymous named function that bleeds into the inner scope).final boolean
Returnstrue
if the variable is declared or inferred to be a constant.final boolean
final boolean
isDefine()
Returnstrue
if the variable is declared as a define.final boolean
isGlobal()
final boolean
isLocal()
final boolean
isThis()
-
Method Details
-
getName
Description copied from interface:StaticSlot
Gets the name of the slot.- Specified by:
getName
in interfaceStaticSlot
-
getScopeRoot
-
getNode
Description copied from interface:StaticRef
The node where the reference lives. -
getSourceFile
Description copied from interface:StaticRef
The source file where the reference lives.- Specified by:
getSourceFile
in interfaceStaticRef
-
getSymbol
Description copied from interface:StaticRef
The variable that this reference points to. -
getDeclaration
Description copied from interface:StaticSlot
Gets the declaration of this symbol. May not exist.- Specified by:
getDeclaration
in interfaceStaticSlot
-
getParentNode
-
isBleedingFunction
public boolean isBleedingFunction()Whether this is a bleeding function (an anonymous named function that bleeds into the inner scope). -
getScope
- Specified by:
getScope
in interfaceStaticSlot
-
isGlobal
public final boolean isGlobal() -
isLocal
public final boolean isLocal() -
isDeclaredOrInferredConst
public final boolean isDeclaredOrInferredConst()Returnstrue
if the variable is declared or inferred to be a constant. -
isDefine
public final boolean isDefine()Returnstrue
if the variable is declared as a define. A variable is a define if it is annotated by@define
. -
getInitialValue
-
getNameNode
-
getJSDocInfo
Description copied from interface:StaticSlot
Gets the JSDoc for this slot.- Specified by:
getJSDocInfo
in interfaceStaticSlot
-
isDefaultParam
public final boolean isDefaultParam() -
isArguments
public final boolean isArguments() -
isThis
public final boolean isThis() -
equals
-
hashCode
public final int hashCode()
-