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 byScopeto store information about variables.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)VgetDeclaration()Gets the declaration of this symbol.NodegetInitialValue()JSDocInfogetJSDocInfo()Gets the JSDoc for this slot.java.lang.StringgetName()Gets the name of the slot.NodegetNameNode()NodegetNode()The node where the reference lives.NodegetParentNode()SgetScope()NodegetScopeRoot()StaticSourceFilegetSourceFile()The source file where the reference lives.VgetSymbol()The variable that this reference points to.inthashCode()booleanisArguments()booleanisBleedingFunction()Whether this is a bleeding function (an anonymous named function that bleeds into the inner scope).booleanisDeclaredOrInferredConst()Returnstrueif the variable is declared or inferred to be a constant.booleanisDefaultParam()booleanisDefine()Returnstrueif the variable is declared as a define.booleanisGlobal()booleanisLocal()booleanisThis()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:StaticSlotGets the name of the slot.- Specified by:
getNamein interfaceStaticSlot
-
getScopeRoot
public final Node getScopeRoot()
-
getNode
public final Node getNode()
Description copied from interface:StaticRefThe node where the reference lives.
-
getSourceFile
public final StaticSourceFile getSourceFile()
Description copied from interface:StaticRefThe source file where the reference lives.- Specified by:
getSourceFilein interfaceStaticRef
-
getSymbol
public final V getSymbol()
Description copied from interface:StaticRefThe variable that this reference points to.
-
getDeclaration
public final V getDeclaration()
Description copied from interface:StaticSlotGets the declaration of this symbol. May not exist.- Specified by:
getDeclarationin interfaceStaticSlot
-
getParentNode
public final 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:
getScopein interfaceStaticSlot
-
isGlobal
public boolean isGlobal()
-
isLocal
public final boolean isLocal()
-
isDeclaredOrInferredConst
public final boolean isDeclaredOrInferredConst()
Returnstrueif the variable is declared or inferred to be a constant.
-
isDefine
public final boolean isDefine()
Returnstrueif the variable is declared as a define. A variable is a define if it is annotated by@define.
-
getInitialValue
public final Node getInitialValue()
-
getNameNode
public Node getNameNode()
-
getJSDocInfo
public JSDocInfo getJSDocInfo()
Description copied from interface:StaticSlotGets the JSDoc for this slot.- Specified by:
getJSDocInfoin interfaceStaticSlot
-
isDefaultParam
public final boolean isDefaultParam()
-
isArguments
public final boolean isArguments()
-
isThis
public final boolean isThis()
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-