public class TypedVar extends Var implements StaticTypedSlot<JSType>, StaticTypedRef<JSType>
isVar
throw an exception when called.
The reason for this is that we want to shadow methods from the parent class, to avoid calling
them accidentally.Modifier and Type | Field and Description |
---|---|
private boolean |
markedAssignedExactlyOnce |
private boolean |
markedEscaped |
(package private) TypedScope |
scope |
private JSType |
type |
private boolean |
typeInferred
Whether the variable's type has been inferred or is declared.
|
Constructor and Description |
---|
TypedVar(boolean inferred,
java.lang.String name,
Node nameNode,
JSType type,
TypedScope scope,
int index,
CompilerInput input) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
TypedVar |
getDeclaration()
Gets the declaration of this symbol.
|
Node |
getInitialValue() |
(package private) CompilerInput |
getInput() |
java.lang.String |
getInputName() |
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.
|
Node |
getParentNode() |
TypedScope |
getScope() |
StaticSourceFile |
getSourceFile()
The source file where the reference lives.
|
TypedVar |
getSymbol()
The variable that this reference points to.
|
JSType |
getType()
Gets this variable's type.
|
int |
hashCode() |
boolean |
isBleedingFunction()
Whether this is a bleeding function (an anonymous named function
that bleeds into the inner scope).
|
(package private) boolean |
isConst() |
boolean |
isDefine()
Returns
true if the variable is declared as a define. |
(package private) boolean |
isExtern() |
boolean |
isGlobal() |
boolean |
isInferredConst()
Returns
true if the variable is declared as a constant,
based on the value reported by NodeUtil . |
(package private) boolean |
isLet() |
boolean |
isLocal() |
(package private) boolean |
isMarkedAssignedExactlyOnce() |
(package private) boolean |
isMarkedEscaped() |
(package private) boolean |
isParam() |
boolean |
isTypeInferred()
Returns whether this variable's type is inferred.
|
(package private) boolean |
isVar() |
(package private) void |
markAssignedExactlyOnce() |
(package private) void |
markEscaped() |
(package private) void |
resolveType(ErrorReporter errorReporter) |
(package private) void |
setType(JSType type) |
java.lang.String |
toString() |
declarationType, isArguments, isCatch, isClass, isDefaultParam, makeArgumentsVar
final TypedScope scope
private JSType type
private boolean markedEscaped
private boolean markedAssignedExactlyOnce
private final boolean typeInferred
TypedVar(boolean inferred, java.lang.String name, Node nameNode, JSType type, TypedScope scope, int index, CompilerInput input)
public java.lang.String getName()
StaticSlot
getName
in interface StaticSlot
getName
in class Var
public Node getNode()
StaticRef
CompilerInput getInput()
public StaticSourceFile getSourceFile()
StaticRef
getSourceFile
in interface StaticRef
getSourceFile
in class Var
public TypedVar getSymbol()
StaticRef
public TypedVar getDeclaration()
StaticSlot
getDeclaration
in interface StaticTypedSlot<JSType>
getDeclaration
in interface StaticSlot
getDeclaration
in class Var
public Node getParentNode()
getParentNode
in class Var
public boolean isBleedingFunction()
Var
isBleedingFunction
in class Var
public TypedScope getScope()
public boolean isInferredConst()
Var
true
if the variable is declared as a constant,
based on the value reported by NodeUtil
.isInferredConst
in class Var
public boolean isDefine()
Var
true
if the variable is declared as a define.
A variable is a define if it is annotated by @define
.public Node getInitialValue()
getInitialValue
in class Var
public Node getNameNode()
getNameNode
in class Var
public JSDocInfo getJSDocInfo()
StaticSlot
getJSDocInfo
in interface StaticSlot
getJSDocInfo
in class Var
public JSType getType()
#isTypeInferred()
.getType
in interface StaticTypedSlot<JSType>
null
if no type is declared for it.void setType(JSType type)
void resolveType(ErrorReporter errorReporter)
public boolean isTypeInferred()
getType()
.isTypeInferred
in interface StaticTypedSlot<JSType>
public java.lang.String getInputName()
void markEscaped()
boolean isMarkedEscaped()
void markAssignedExactlyOnce()
boolean isMarkedAssignedExactlyOnce()