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.boolean
boolean
Determines whether the variable is initialized at the declaration.boolean
isLvalue()
Returns whether the name node for this reference is an lvalue.boolean
boolean
toString()
-
Method Details
-
toString
-
getSymbol
Description copied from interface:StaticRef
The variable that this reference points to. -
getNode
Description copied from interface:StaticRef
The node where the reference lives. -
getInputId
-
getSourceFile
Description copied from interface:StaticRef
The source file where the reference lives.- Specified by:
getSourceFile
in 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.
-