Package com.google.javascript.jscomp
Class Reference
java.lang.Object
com.google.javascript.jscomp.Reference
- All Implemented Interfaces:
StaticRef,Serializable
Represents a single declaration or reference to a variable. Note that references can only be used
with untyped scopes and traversals.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetNode()The node where the reference lives.The source file where the reference lives.The variable that this reference points to.booleanbooleanDetermines whether the variable is initialized at the declaration.booleanisLvalue()Returns whether the name node for this reference is an lvalue.booleanbooleantoString()
-
Method Details
-
toString
-
getSymbol
Description copied from interface:StaticRefThe variable that this reference points to. -
getNode
Description copied from interface:StaticRefThe node where the reference lives. -
getInputId
-
getSourceFile
Description copied from interface:StaticRefThe source file where the reference lives.- Specified by:
getSourceFilein interfaceStaticRef
-
isVarDeclaration
public boolean isVarDeclaration() -
isConstDeclaration
public boolean isConstDeclaration() -
isInitializingDeclaration
public boolean isInitializingDeclaration()Determines whether the variable is initialized at the declaration. -
isSimpleAssignmentToName
public boolean isSimpleAssignmentToName() -
isLvalue
public boolean isLvalue()Returns whether the name node for this reference is an lvalue. TODO(tbreisacher): This method disagrees with NodeUtil#isLValue for "var x;" and "let x;". Consider updating it to match.
-