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
,java.io.Serializable
public class AbstractVar<S extends AbstractScope<S,V>,V extends AbstractVar<S,V>> extends java.lang.Object implements StaticSlot, StaticRef
Used byScope
to store information about variables.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
V
getDeclaration()
Gets the declaration of this symbol.@Nullable Node
getInitialValue()
@Nullable JSDocInfo
getJSDocInfo()
Gets the JSDoc for this slot.java.lang.String
getName()
Gets the name of the slot.Node
getNameNode()
Node
getNode()
The node where the reference lives.@Nullable Node
getParentNode()
S
getScope()
Node
getScopeRoot()
StaticSourceFile
getSourceFile()
The source file where the reference lives.V
getSymbol()
The variable that this reference points to.int
hashCode()
boolean
isArguments()
boolean
isBleedingFunction()
Whether this is a bleeding function (an anonymous named function that bleeds into the inner scope).boolean
isDeclaredOrInferredConst()
Returnstrue
if the variable is declared or inferred to be a constant.boolean
isDefaultParam()
boolean
isDefine()
Returnstrue
if the variable is declared as a define.boolean
isGlobal()
boolean
isLocal()
boolean
isThis()
-
-
-
Method Detail
-
getName
public final java.lang.String getName()
Description copied from interface:StaticSlot
Gets the name of the slot.- Specified by:
getName
in interfaceStaticSlot
-
getScopeRoot
public final Node getScopeRoot()
-
getNode
public final Node getNode()
Description copied from interface:StaticRef
The node where the reference lives.
-
getSourceFile
public final StaticSourceFile getSourceFile()
Description copied from interface:StaticRef
The source file where the reference lives.- Specified by:
getSourceFile
in interfaceStaticRef
-
getSymbol
public final V getSymbol()
Description copied from interface:StaticRef
The variable that this reference points to.
-
getDeclaration
public final V getDeclaration()
Description copied from interface:StaticSlot
Gets the declaration of this symbol. May not exist.- Specified by:
getDeclaration
in interfaceStaticSlot
-
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 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
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 interfaceStaticSlot
-
isDefaultParam
public final boolean isDefaultParam()
-
isArguments
public final boolean isArguments()
-
isThis
public final boolean isThis()
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-