Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.lint | |
com.google.javascript.refactoring |
Modifier and Type | Class and Description |
---|---|
class |
Compiler
Compiler (and the other classes in this package) does the following:
parses JS code
checks for undefined variables
performs optimizations such as constant folding and constants inlining
renames variables (to short names)
outputs compact JavaScript code
External variables are declared in 'externs' files.
|
Modifier and Type | Method and Description |
---|---|
AbstractCompiler |
NodeTraversal.getCompiler() |
Modifier and Type | Method and Description |
---|---|
Node |
SyntheticAst.getAstRoot(AbstractCompiler compiler) |
Node |
JsAst.getAstRoot(AbstractCompiler compiler) |
Node |
SourceAst.getAstRoot(AbstractCompiler compiler)
Gets the root node of the AST for the source file this represents.
|
Node |
CompilerInput.getAstRoot(AbstractCompiler compiler) |
static boolean |
NodeUtil.mayHaveSideEffects(Node n,
AbstractCompiler compiler) |
static Node |
NodeUtil.newPropertyAccess(AbstractCompiler compiler,
Node context,
String name)
Creates a property access on the
context tree. |
static Node |
NodeUtil.newQName(AbstractCompiler compiler,
String name)
Creates a node representing a qualified name.
|
static Node |
NodeUtil.newQNameDeclaration(AbstractCompiler compiler,
String name,
Node value,
JSDocInfo info)
Creates a node representing a qualified name.
|
void |
CompilerInput.setCompiler(AbstractCompiler compiler)
Sets an abstract compiler for doing parsing.
|
static void |
NodeTraversal.traverse(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Traverses a node recursively.
|
static void |
NodeTraversal.traverseChangedFunctions(AbstractCompiler compiler,
NodeTraversal.FunctionCallback callback)
Traversal for passes that work only on changed functions.
|
static void |
NodeTraversal.traverseRoots(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseTyped(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb) |
static void |
NodeUtil.verifyScopeChanges(Map<Node,Node> map,
Node main,
boolean verifyUnchangedNodes,
AbstractCompiler compiler)
Checks that the scope roots marked as changed have indeed changed
|
void |
NodeTraversal.FunctionCallback.visit(AbstractCompiler compiler,
Node fnRoot) |
Constructor and Description |
---|
AbstractRule(AbstractCompiler compiler,
Requirement requirement) |
AstValidator(AbstractCompiler compiler) |
AstValidator(AbstractCompiler compiler,
AstValidator.ViolationHandler handler) |
BanExpose(AbstractCompiler compiler,
Requirement requirement) |
BanGlobalVars(AbstractCompiler compiler,
Requirement requirement) |
BanThrowOfNonErrorTypes(AbstractCompiler compiler,
Requirement requirement) |
BanUnknownDirectThisPropsReferences(AbstractCompiler compiler,
Requirement requirement) |
BanUnknownThis(AbstractCompiler compiler,
Requirement requirement) |
BanUnresolvedType(AbstractCompiler compiler,
Requirement requirement) |
CallGraph(AbstractCompiler compiler)
Creates a call graph object support both forward and backward lookups.
|
CallGraph(AbstractCompiler compiler,
boolean computeForwardGraph,
boolean computeBackwardGraph)
Creates a call graph object supporting the specified lookups.
|
CheckEventfulObjectDisposal(AbstractCompiler compiler,
CheckEventfulObjectDisposal.DisposalCheckingPolicy checkingPolicy) |
ConvertToTypedES6(AbstractCompiler compiler) |
Es6ConvertSuper(AbstractCompiler compiler) |
Es6RenameVariablesInParamLists(AbstractCompiler compiler) |
Es6RewriteGenerators(AbstractCompiler compiler) |
Es6RewriteLetConst(AbstractCompiler compiler) |
Es6SplitVariableDeclarations(AbstractCompiler compiler) |
Es6ToEs3ClassSideInheritance(AbstractCompiler compiler) |
Es6ToEs3Converter(AbstractCompiler compiler) |
FieldCleanupPass(AbstractCompiler compiler) |
ImplicitNullabilityCheck(AbstractCompiler compiler) |
JsMessageVisitor(AbstractCompiler compiler,
boolean needToCheckDuplications,
JsMessage.Style style,
JsMessage.IdGenerator idGenerator)
Creates JS message visitor.
|
NodeTraversal(AbstractCompiler compiler,
NodeTraversal.Callback cb)
Creates a node traversal using the specified callback interface.
|
NodeTraversal(AbstractCompiler compiler,
NodeTraversal.Callback cb,
com.google.javascript.jscomp.ScopeCreator scopeCreator)
Creates a node traversal using the specified callback interface
and the scope creator.
|
NoImplicitlyPublicDecls(AbstractCompiler compiler,
Requirement requirement) |
RequireFileoverviewVisibility(AbstractCompiler compiler,
Requirement requirement) |
TemplateAstMatcher(AbstractCompiler compiler,
Node templateFunctionNode)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
TemplateAstMatcher(AbstractCompiler compiler,
Node templateFunctionNode,
TypeMatchingStrategy typeMatchingStrategy)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
TypeCheck(AbstractCompiler compiler,
ReverseAbstractInterpreter reverseInterpreter,
JSTypeRegistry typeRegistry,
CheckLevel reportMissingOverride) |
TypeCheck(AbstractCompiler compiler,
ReverseAbstractInterpreter reverseInterpreter,
JSTypeRegistry typeRegistry,
TypedScope topScope,
com.google.javascript.jscomp.MemoizedScopeCreator scopeCreator,
CheckLevel reportMissingOverride) |
Constructor and Description |
---|
CheckEnums(AbstractCompiler compiler) |
CheckInterfaces(AbstractCompiler compiler) |
CheckJSDoc(AbstractCompiler compiler) |
CheckNullableReturn(AbstractCompiler compiler) |
CheckPrototypeProperties(AbstractCompiler compiler) |
Modifier and Type | Method and Description |
---|---|
AbstractCompiler |
NodeMetadata.getCompiler() |
Modifier and Type | Method and Description |
---|---|
SuggestedFix.Builder |
SuggestedFix.Builder.addCast(Node n,
AbstractCompiler compiler,
String type)
Adds a cast of the given type to the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.changeJsDocType(Node n,
AbstractCompiler compiler,
String type)
Changes the JS Doc Type of the given node.
|
String |
SuggestedFix.Builder.generateCode(AbstractCompiler compiler,
Node node) |
static List<SuggestedFix> |
ErrorToFixMapper.getFixesForJsError(JSError error,
AbstractCompiler compiler) |
static SuggestedFix |
ErrorToFixMapper.getFixForJsError(JSError error,
AbstractCompiler compiler) |
SuggestedFix.Builder |
SuggestedFix.Builder.insertBefore(Node nodeToInsertBefore,
Node n,
AbstractCompiler compiler)
Inserts a new node before the provided node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.removeCast(Node n,
AbstractCompiler compiler)
Removes a cast from the given node.
|
SuggestedFix.Builder |
SuggestedFix.Builder.replace(Node original,
Node newNode,
AbstractCompiler compiler)
Replaces the provided node with new node in the source file.
|
Constructor and Description |
---|
JsSourceMatcher(AbstractCompiler compiler,
Node templateNode)
Constructs this matcher with a Function node that serves as the template
to match all other nodes against.
|
NodeMetadata(AbstractCompiler compiler) |
Copyright © 2009-2015 Google. All Rights Reserved.