Package com.google.javascript.jscomp
package com.google.javascript.jscomp
Provides the core compiler and its public API.
-
ClassDescriptionAn abstract compiler, to help remove the circular dependency of passes on JSCompiler.Abstract message formatter providing default behavior for implementations of
MessageFormatter
needing aSourceExcerptProvider
.Strategies for how to do naming of anonymous functions that occur as r-values in assignments and variable declarations.This class walks the AST and validates that the structure is correct.A basic error manager that sorts all errors and warnings reported to it to generate a sorted report when theBasicErrorManager.generateReport()
method is called.An implementation of aWarningsGuard
that can modify theCheckLevel
based on the file that caused the warning, and whether this file matches a set of paths (specified either as include or exclude of path name parts).A pass the uses aDefinitionProvider
to compute a call graph for an AST.Controls checking levels of certain options.Enum used in flags to control the behavior of JS compiler checks.This describes the Closure-specific JavaScript coding conventions.A function that will throw an exception when if the value is not an instanceof a specific type.CodingConvention defines a set of hooks to customize the behavior of the Compiler for a specific team/company.A function that will throw an exception when either: -One or more of its parameters evaluate to false.Delegates provides a mechanism and structure for identifying where classes can call out to optional code to augment their functionality.An object literal cast provides a mechanism to cast object literals to other types without a warning.Helper classes for dealing with coding conventions.A convention that wraps another.CommandLineRunner translates flags into Java API calls on the Compiler.A CompilationLevel represents the level of optimization that should be applied when compiling JavaScript code.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.Stores a buffer of text to which more can be appended.Stores the internal compiler state just before optimization is performed.A class for the internal representation of an input to the compiler.Compiler optionsA Role Specific Interface for the JS Compiler to report aliases used to change the code during a compile.A Role Specific Interface for JS Compiler that represents a data holder object which is used to store goog.scope alias code changes to code made during a compile.When to do the extra sanity checksInterface for classes that can compile JS.WarningsGuard that represents just a chain of other guards.Interface used byReplaceCssNames
to substitute CSS class names.Custom pass type.Pass factories and meta-data for native JSCompiler passes.Options for how to manage dependencies between input files.Group a set of related diagnostic types together, so that they can be toggled on and off as one unit.Named groups of DiagnosticTypes exposed by Compiler.Sets the level for a particular DiagnosticGroup.The type of a compile or analysis error.DotFormatter prints out a dot file of the Abstract Syntax Tree.An implementation of MessageBundle that has no translations.Error formats available.The error handler is any generic sink for warnings and errors, after they've passed through any filteringWarningsGuard
s.The error manager is in charge of storing, organizing and displaying errors and warnings generated by the compiler.A CleanupPass implementation that will remove all field declarations on JSTypes contributed by the original file.Records all of the symbols and properties that should be exported.Context holding the node references required for generating the export calls.Protobuf typejscomp.FunctionInformationMap
Protobuf typejscomp.FunctionInformationMap
Protobuf typejscomp.FunctionInformationMap.Entry
Protobuf typejscomp.FunctionInformationMap.Entry
Protobuf typejscomp.FunctionInformationMap.Module
Protobuf typejscomp.FunctionInformationMap.Module
This describes the Google-specific JavaScript coding conventions.AnJsMessage.IdGenerator
designed to play nicely with Google's Translation systems.Interface for compiler passes that can be used in a hot-swap fashion.InlineProperties attempts to find references to properties that are known to be constants and inline the known value.Protobuf typejscomp.Instrumentation
Protobuf typejscomp.Instrumentation
This describes the jQuery specific JavaScript coding conventions.Generates an AST for a JavaScript source file.Compile error descriptionA representation of a translatable message in JavaScript source code.Contains functionality for creating JS messages.A reference to a placeholder in a translatable message.Message style that could be used for JS code parsing.Extracts messages and message comments from JS code.A JavaScript module has a unique name, consists of a list of compiler inputs, and can depend on other modules.AJSModule
dependency graph that assigns a depth to each module and can answer depth-related queries about them.Deprecated.JSSourceFile is an empty wrapper around SourceFile.Lightweight message formatter.An error manager that logs errors and warnings using a logger in addition to collecting them in memory.An interface for providing alternative values for user-visible messages in JavaScript code.Format warnings and errors.NodeTraversal allows an iteration through the nodes in the parse tree, and facilitates the optimizations on the parse tree.Abstract callback to visit a pruned set of nodes.Abstract callback to visit all nodes in post order.Abstract scoped callback to visit all nodes in post order.Abstract callback to visit all nodes but not traverse into function bodies.Abstract callback to visit all structure and statement nodes but doesn't traverse into functions or expressions.CallbackCallback that also knows about scope changesNodeUtil contains generally useful AST utilities.Rewritesnew goog.testing.ObjectPropertyString(foo, 'bar')
tonew JSCompiler_ObjectPropertyString(window, foo.bar)
.Pass factories and meta-data for native Compiler passes.Intermediate state for a running pass configuration.A factory for creating JSCompiler passes based on the Options injected.A pass that looks for assignments to properties of an object or array immediately following its creation using the abbreviated syntax.For each pass, keep track of the runtime, the size changes, etcAn error manager that prints errors and warnings to the print stream provided in addition to the functionality of theBasicErrorManager
.Rewrites a CommonJS module http://wiki.commonjs.org/wiki/Modules/1.1.1 into a form that can be safely concatenated.Policies to determine how properties should be renamed.Source code region.Compilation resultsScope contains information about a variable scope in JavaScript.A special subclass of Var used to distinguish "arguments" in the current scope.Stores info about a variableControl whether warnings should be restricted or suppressed for specified paths.Controls whether warnings should be restricted to a specified path or suppressed within the specified path.Simple region.An interface for accessing the AST root of an input.A source excerpt provider is responsible for building source code excerpt of specific locations, such as a specific line or a region around a given line number.A excerpt formatter is responsible of formatting source excerpts.Source excerpt variety.An abstract representation of a source file that provides access to language-neutral features.A builder interface for source files.A JavaScript source code provider.Collects information mapping the generated (compiled) source back to its original source for debugging purposes.Source maps can be very large different levels of detail can be specified.Tries to fuse all the statements in a block into a one statement by using COMMAs.All warnings should be reported as errors.A symbol table for people that want to use Closure Compiler as an indexer.An AST generated totally by the compiler.Checks the types of JS expressions against any declared type information.Stores the mapping from original variable name to new variable names.Policies to determine which variables should be renamed.Convert the warnings level to an Options object.Class that allows to flexibly manage what to do with a reported warning/error.An extension ofWarningsGuard
that provides functionality to maintain a list of warnings (white-list).A MessageBundle that parses messages from an XML Translation Bundle (XTB) file.