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 | Field and Description |
---|---|
protected AbstractCompiler |
NameBasedDefinitionProvider.compiler |
Modifier and Type | Method and Description |
---|---|
AbstractCompiler |
NodeTraversal.getCompiler() |
AbstractCompiler |
HasCompiler.getCompiler() |
Modifier and Type | Method and Description |
---|---|
protected abstract CompilerPass |
PassFactory.create(AbstractCompiler compiler)
Creates a new compiler pass to be run.
|
protected abstract HotSwapCompilerPass |
PassFactory.HotSwapPassFactory.create(AbstractCompiler compiler) |
static void |
NodeUtil.deleteChildren(Node n,
AbstractCompiler compiler)
Permanently delete all the children of the given node, including reporting changes.
|
static void |
NodeUtil.deleteFunctionCall(Node n,
AbstractCompiler compiler)
Permanently delete the given call from the AST while maintaining a valid node structure, as
well as report the related AST changes to the given compiler.
|
static void |
NodeUtil.deleteNode(Node n,
AbstractCompiler compiler)
Permanently delete the given node from the AST, as well as report
the related AST changes/deletions to the given compiler.
|
void |
NodeTraversal.ChangeScopeRootCallback.enterChangeScopeRoot(AbstractCompiler compiler,
Node root) |
Node |
CompilerInput.getAstRoot(AbstractCompiler compiler) |
Node |
SyntheticAst.getAstRoot(AbstractCompiler compiler) |
Node |
SourceAst.getAstRoot(AbstractCompiler compiler)
Gets the root node of the AST for the source file this represents.
|
Node |
JsAst.getAstRoot(AbstractCompiler compiler) |
Node |
RecoverableJsAst.getAstRoot(AbstractCompiler compiler) |
static ControlFlowGraph<Node> |
ControlFlowAnalysis.getCfg(AbstractCompiler compiler,
Node cfgRoot) |
FeatureSet |
JsAst.getFeatures(AbstractCompiler compiler) |
protected HotSwapCompilerPass |
PassFactory.getHotSwapPass(AbstractCompiler compiler)
Any factory whose CompilerPass has a corresponding hot-swap version should
override this.
|
protected HotSwapCompilerPass |
PassFactory.HotSwapPassFactory.getHotSwapPass(AbstractCompiler compiler) |
static SyntacticScopeCreator |
SyntacticScopeCreator.makeUntyped(AbstractCompiler compiler)
Deprecated.
Use Es6SyntacticScopeCreator instead.
|
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.
|
void |
JSModule.sortInputsByDeps(AbstractCompiler compiler)
Puts the JS files into a topologically sorted order by their dependencies.
|
static void |
NodeTraversal.traverseChangedFunctions(AbstractCompiler compiler,
NodeTraversal.ChangeScopeRootCallback callback)
Traversal for passes that work only on changed functions.
|
static void |
NodeTraversal.traverseEs6(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb)
Traverses using the ES6SyntacticScopeCreator
|
static void |
NodeTraversal.traverseEs6ScopeRoots(AbstractCompiler compiler,
Node root,
List<Node> scopeNodes,
NodeTraversal.Callback cb,
boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within
them) but will fall back on traversing the entire AST from root if a null scope nodes list is
provided.
|
static void |
NodeTraversal.traverseEs6ScopeRoots(AbstractCompiler compiler,
Node root,
List<Node> scopeNodes,
NodeTraversal.Callback cb,
NodeTraversal.ChangeScopeRootCallback changeCallback,
boolean traverseNested)
Traverses *just* the contents of provided scope nodes (and optionally scopes nested within
them) but will fall back on traversing the entire AST from root if a null scope nodes list is
provided.
|
static void |
NodeTraversal.traverseRootsEs6(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseRootsTyped(AbstractCompiler compiler,
NodeTraversal.Callback cb,
Node externs,
Node root) |
static void |
NodeTraversal.traverseTyped(AbstractCompiler compiler,
Node root,
NodeTraversal.Callback cb) |
Constructor and Description |
---|
CheckArrayWithGoogObject(AbstractCompiler compiler) |
CheckDuplicateCase(AbstractCompiler compiler) |
CheckEmptyStatements(AbstractCompiler compiler) |
CheckEnums(AbstractCompiler compiler) |
CheckInterfaces(AbstractCompiler compiler) |
CheckJSDocStyle(AbstractCompiler compiler) |
CheckMissingSemicolon(AbstractCompiler compiler) |
CheckNullableReturn(AbstractCompiler compiler) |
CheckPrimitiveAsObject(AbstractCompiler compiler) |
CheckPrototypeProperties(AbstractCompiler compiler) |
CheckRequiresAndProvidesSorted(AbstractCompiler compiler) |
CheckUnusedLabels(AbstractCompiler compiler) |
CheckUselessBlocks(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.attachMatchedNodeInfo(Node node,
AbstractCompiler compiler)
Sets the node on this SuggestedFix that caused this SuggestedFix to be built in the first
place.
|
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)
Creates a SuggestedFix for the given error.
|
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.
|
void |
FixingErrorManager.setCompiler(AbstractCompiler compiler) |
Constructor and Description |
---|
NodeMetadata(AbstractCompiler compiler) |
Copyright © 2009-2017 Google. All Rights Reserved.