class VariableReferenceCheck extends java.lang.Object implements HotSwapCompilerPass
VarCheck,
but it lacks the cross-module checks.| Modifier and Type | Class and Description |
|---|---|
private class |
VariableReferenceCheck.ReferenceCheckingBehavior
Behavior that checks variables for redeclaration or early references
just after they go out of scope.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static DiagnosticType |
AMBIGUOUS_FUNCTION_DECL |
private java.util.Set<ReferenceCollectingCallback.BasicBlock> |
blocksWithDeclarations |
private AbstractCompiler |
compiler |
(package private) static DiagnosticType |
DECLARATION_NOT_DIRECTLY_IN_BLOCK |
(package private) static DiagnosticType |
EARLY_REFERENCE |
(package private) static DiagnosticType |
EARLY_REFERENCE_ERROR |
(package private) static DiagnosticType |
REASSIGNED_CONSTANT |
(package private) static DiagnosticType |
REDECLARED_VARIABLE |
(package private) static DiagnosticType |
REDECLARED_VARIABLE_ERROR |
(package private) static DiagnosticType |
UNUSED_LOCAL_ASSIGNMENT |
| Constructor and Description |
|---|
VariableReferenceCheck(AbstractCompiler compiler) |
| Modifier and Type | Method and Description |
|---|---|
void |
hotSwapScript(Node scriptRoot,
Node originalRoot)
Process the JS with root node root.
|
void |
process(Node externs,
Node root)
Process the JS with root node root.
|
static final DiagnosticType EARLY_REFERENCE
static final DiagnosticType REDECLARED_VARIABLE
static final DiagnosticType AMBIGUOUS_FUNCTION_DECL
static final DiagnosticType EARLY_REFERENCE_ERROR
static final DiagnosticType REASSIGNED_CONSTANT
static final DiagnosticType REDECLARED_VARIABLE_ERROR
static final DiagnosticType DECLARATION_NOT_DIRECTLY_IN_BLOCK
static final DiagnosticType UNUSED_LOCAL_ASSIGNMENT
private final AbstractCompiler compiler
private final java.util.Set<ReferenceCollectingCallback.BasicBlock> blocksWithDeclarations
public VariableReferenceCheck(AbstractCompiler compiler)
public void process(Node externs, Node root)
CompilerPassprocess in interface CompilerPassexterns - Top of external JS treeroot - Top of JS treepublic void hotSwapScript(Node scriptRoot, Node originalRoot)
HotSwapCompilerPasshotSwapScript in interface HotSwapCompilerPassscriptRoot - Root node corresponding to the file that is modified,
should be of type Token.SCRIPT.originalRoot - Root node corresponding to the original version of the
file that is modified. Should be of type token.SCRIPT.