public final class ClosureCheckModule extends NodeTraversal.AbstractModuleCallback implements HotSwapCompilerPass
Note that this file only does checks that can be done per-file. Whole program checks happen
during goog.module rewriting, in ClosureRewriteModule
.
Modifier and Type | Field and Description |
---|---|
static DiagnosticType |
JSDOC_REFERENCE_TO_SHORT_IMPORT_BY_LONG_NAME_INCLUDING_SHORT_NAME |
static DiagnosticType |
REFERENCE_TO_SHORT_IMPORT_BY_LONG_NAME_INCLUDING_SHORT_NAME |
compiler
Constructor and Description |
---|
ClosureCheckModule(AbstractCompiler compiler,
ModuleMetadataMap moduleMetadataMap) |
Modifier and Type | Method and Description |
---|---|
void |
enterModule(ModuleMetadataMap.ModuleMetadata currentModule,
Node moduleScopeRoot) |
void |
exitModule(ModuleMetadataMap.ModuleMetadata currentModule,
Node moduleScopeRoot) |
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.
|
protected void |
visit(NodeTraversal t,
Node n,
ModuleMetadataMap.ModuleMetadata currentModule,
Node moduleScopeRoot) |
shouldTraverse, shouldTraverse, visit
public static final DiagnosticType REFERENCE_TO_SHORT_IMPORT_BY_LONG_NAME_INCLUDING_SHORT_NAME
public static final DiagnosticType JSDOC_REFERENCE_TO_SHORT_IMPORT_BY_LONG_NAME_INCLUDING_SHORT_NAME
public ClosureCheckModule(AbstractCompiler compiler, ModuleMetadataMap moduleMetadataMap)
public void process(Node externs, Node root)
CompilerPass
process
in interface CompilerPass
externs
- Top of external JS treeroot
- Top of JS treepublic void hotSwapScript(Node scriptRoot, Node originalRoot)
HotSwapCompilerPass
hotSwapScript
in interface HotSwapCompilerPass
scriptRoot
- 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
.public void enterModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
enterModule
in class NodeTraversal.AbstractModuleCallback
public void exitModule(ModuleMetadataMap.ModuleMetadata currentModule, Node moduleScopeRoot)
exitModule
in class NodeTraversal.AbstractModuleCallback
protected void visit(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node moduleScopeRoot)
visit
in class NodeTraversal.AbstractModuleCallback
Copyright © 2009-2019 Google. All Rights Reserved.