Package com.google.javascript.jscomp
Class CheckMissingRequires
java.lang.Object
com.google.javascript.jscomp.NodeTraversal.AbstractModuleCallback
com.google.javascript.jscomp.CheckMissingRequires
- All Implemented Interfaces:
CompilerPass
,NodeTraversal.Callback
public class CheckMissingRequires
extends NodeTraversal.AbstractModuleCallback
implements CompilerPass
A pass to detect references to fully qualified Closure namespaces.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
static final DiagnosticType
Fields inherited from class com.google.javascript.jscomp.NodeTraversal.AbstractModuleCallback
compiler
-
Constructor Summary
ConstructorsConstructorDescriptionCheckMissingRequires
(AbstractCompiler compiler, ModuleMetadataMap moduleMetadataMap) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Process the JS with root node root.boolean
shouldTraverse
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot) void
visit
(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node scopeRoot) Methods inherited from class com.google.javascript.jscomp.NodeTraversal.AbstractModuleCallback
enterModule, exitModule, shouldTraverse, visit
-
Field Details
-
MISSING_REQUIRE
-
MISSING_REQUIRE_TYPE
-
INCORRECT_NAMESPACE_ALIAS_REQUIRE
-
INCORRECT_NAMESPACE_ALIAS_REQUIRE_TYPE
-
INDIRECT_NAMESPACE_REF_REQUIRE
-
INDIRECT_NAMESPACE_REF_REQUIRE_TYPE
-
MISSING_REQUIRE_IN_PROVIDES_FILE
-
MISSING_REQUIRE_TYPE_IN_PROVIDES_FILE
-
NON_LEGACY_GOOG_MODULE_REFERENCE
-
MISSING_REQUIRE_FOR_GOOG_MODULE_GET
-
-
Constructor Details
-
CheckMissingRequires
-
-
Method Details
-
process
Description copied from interface:CompilerPass
Process the JS with root node root. Can modify the contents of each Node tree- Specified by:
process
in interfaceCompilerPass
- Parameters:
externs
- Top of external JS treeroot
- Top of JS tree
-
shouldTraverse
public boolean shouldTraverse(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, Node scopeRoot) Description copied from class:NodeTraversal.AbstractModuleCallback
- Overrides:
shouldTraverse
in classNodeTraversal.AbstractModuleCallback
- Parameters:
t
- The current traversal.n
- The current node.currentModule
- The current module, or null if not inside a module (e.g. AST root).scopeRoot
- The root scope for the current module, or null if not inside a module (e.g. AST root).- Returns:
- whether the children of this node should be visited
-
visit
public void visit(NodeTraversal t, Node n, @Nullable ModuleMetadataMap.ModuleMetadata currentModule, @Nullable Node scopeRoot) Description copied from class:NodeTraversal.AbstractModuleCallback
- Overrides:
visit
in classNodeTraversal.AbstractModuleCallback
- Parameters:
t
- The current traversal.n
- The current node.currentModule
- The current module, or null if not inside a module (e.g. AST root).scopeRoot
- The root scope for the current module, or null if not inside a module (e.g. AST root).
-