Package com.google.javascript.jscomp
Class Reference
- java.lang.Object
-
- com.google.javascript.jscomp.Reference
-
- All Implemented Interfaces:
StaticRef
,java.io.Serializable
public final class Reference extends java.lang.Object implements StaticRef, java.io.Serializable
Represents a single declaration or reference to a variable. Note that references can only be used with untyped scopes and traversals.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputId
getInputId()
Node
getNode()
The node where the reference lives.StaticSourceFile
getSourceFile()
The source file where the reference lives.Var
getSymbol()
The variable that this reference points to.boolean
isConstDeclaration()
boolean
isInitializingDeclaration()
Determines whether the variable is initialized at the declaration.boolean
isLvalue()
Returns whether the name node for this reference is an lvalue.boolean
isSimpleAssignmentToName()
boolean
isVarDeclaration()
java.lang.String
toString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getSymbol
public Var getSymbol()
Description copied from interface:StaticRef
The variable that this reference points to.
-
getNode
public Node getNode()
Description copied from interface:StaticRef
The node where the reference lives.
-
getInputId
public InputId getInputId()
-
getSourceFile
public StaticSourceFile 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.
-
-