# Package com.google.javascript.jscomp

package com.google.javascript.jscomp
Provides the core compiler and its public API.

Related Packages
Package
Description
com.google.javascript.jscomp.ant
com.google.javascript.jscomp.deps
Analyzes information about dependencies between files.
com.google.javascript.jscomp.graph
Provides graph data structures and algorithms for coloring and fixed-point computations.
com.google.javascript.jscomp.jsonml
Provides the classes to support JsonML format and secure compiler.
com.google.javascript.jscomp.parsing
Provides utilities to help with parsing JSDoc annotations and performing AST transformations.
com.google.javascript.jscomp.regex
com.google.javascript.jscomp.testing
com.google.javascript.jscomp.type
Provides type-checking data structures and algorithms.
Class
Description
AbstractCompiler
An abstract compiler, to help remove the circular dependency of passes on JSCompiler.
AbstractMessageFormatter
Abstract message formatter providing default behavior for implementations of `MessageFormatter` needing a `SourceExcerptProvider`.
AnonymousFunctionNamingPolicy
Strategies for how to do naming of anonymous functions that occur as r-values in assignments and variable declarations.
AstValidator
This class walks the AST and validates that the structure is correct.
AstValidator.ViolationHandler
BasicErrorManager
A basic error manager that sorts all errors and warnings reported to it to generate a sorted report when the `BasicErrorManager.generateReport()` method is called.
ByPathWarningsGuard
An implementation of a `WarningsGuard` that can modify the `CheckLevel` 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).
CallGraph
A pass the uses a `DefinitionProvider` to compute a call graph for an AST.
CheckLevel
Controls checking levels of certain options.
CheckLevelLegacy
Enum used in flags to control the behavior of JS compiler checks.
ClosureCodingConvention
This describes the Closure-specific JavaScript coding conventions.
ClosureCodingConvention.AssertInstanceofSpec
A function that will throw an exception when if the value is not an instanceof a specific type.
CodingConvention
CodingConvention defines a set of hooks to customize the behavior of the Compiler for a specific team/company.
CodingConvention.AssertionFunctionSpec
A function that will throw an exception when either: -One or more of its parameters evaluate to false.
CodingConvention.Bind
CodingConvention.DelegateRelationship
Delegates provides a mechanism and structure for identifying where classes can call out to optional code to augment their functionality.
CodingConvention.ObjectLiteralCast
An object literal cast provides a mechanism to cast object literals to other types without a warning.
CodingConvention.SubclassRelationship
CodingConvention.SubclassType
CodingConventions
Helper classes for dealing with coding conventions.
CodingConventions.Proxy
A convention that wraps another.
CommandLineRunner
CommandLineRunner translates flags into Java API calls on the Compiler.
CompilationLevel
A CompilationLevel represents the level of optimization that should be applied when compiling JavaScript code.
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.
Compiler.CodeBuilder
Stores a buffer of text to which more can be appended.
Compiler.IntermediateState
Stores the internal compiler state just before optimization is performed.
CompilerInput
A class for the internal representation of an input to the compiler.
CompilerOptions
Compiler options
CompilerOptions.AliasTransformation
A Role Specific Interface for the JS Compiler to report aliases used to change the code during a compile.
CompilerOptions.AliasTransformationHandler
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.
CompilerOptions.LanguageMode
When to do the extra sanity checks
CompilerOptions.Reach
CompilerOptions.TracerMode
CompilerOptions.TweakProcessing
CompilerPass
Interface for classes that can compile JS.
ComposeWarningsGuard
WarningsGuard that represents just a chain of other guards.
CssRenamingMap
Interface used by `ReplaceCssNames` to substitute CSS class names.
CssRenamingMap.ByPart
CssRenamingMap.ByWhole
CssRenamingMap.Style
CustomPassExecutionTime
Custom pass type.
DefaultPassConfig
Pass factories and meta-data for native JSCompiler passes.
DependencyOptions
Options for how to manage dependencies between input files.
DiagnosticGroup
Group a set of related diagnostic types together, so that they can be toggled on and off as one unit.
DiagnosticGroups
Named groups of DiagnosticTypes exposed by Compiler.
DiagnosticGroupWarningsGuard
Sets the level for a particular DiagnosticGroup.
DiagnosticType
The type of a compile or analysis error.
DotFormatter
DotFormatter prints out a dot file of the Abstract Syntax Tree.
EmptyMessageBundle
An implementation of MessageBundle that has no translations.
ErrorFormat
Error formats available.
ErrorHandler
The error handler is any generic sink for warnings and errors, after they've passed through any filtering `WarningsGuard`s.
ErrorManager
The error manager is in charge of storing, organizing and displaying errors and warnings generated by the compiler.
FieldCleanupPass
A CleanupPass implementation that will remove all field declarations on JSTypes contributed by the original file.
FindExportableNodes
Records all of the symbols and properties that should be exported.
FindExportableNodes.GenerateNodeContext
Context holding the node references required for generating the export calls.
FunctionInfo
FunctionInformationMap
Protobuf type `jscomp.FunctionInformationMap`
FunctionInformationMap.Builder
Protobuf type `jscomp.FunctionInformationMap`
FunctionInformationMap.Entry
Protobuf type `jscomp.FunctionInformationMap.Entry`
FunctionInformationMap.Entry.Builder
Protobuf type `jscomp.FunctionInformationMap.Entry`
FunctionInformationMap.EntryOrBuilder
FunctionInformationMap.Module
Protobuf type `jscomp.FunctionInformationMap.Module`
FunctionInformationMap.Module.Builder
Protobuf type `jscomp.FunctionInformationMap.Module`
FunctionInformationMap.ModuleOrBuilder
FunctionInformationMapOrBuilder
GoogleCodingConvention
This describes the Google-specific JavaScript coding conventions.
GoogleJsMessageIdGenerator
An `JsMessage.IdGenerator` designed to play nicely with Google's Translation systems.
HotSwapCompilerPass
Interface for compiler passes that can be used in a hot-swap fashion.
InlineProperties
InlineProperties attempts to find references to properties that are known to be constants and inline the known value.
Instrumentation
Protobuf type `jscomp.Instrumentation`
Instrumentation.Builder
Protobuf type `jscomp.Instrumentation`
InstrumentationOrBuilder
InstrumentationTemplate
JqueryCodingConvention
This describes the jQuery specific JavaScript coding conventions.
JsAst
Generates an AST for a JavaScript source file.
JSError
Compile error description
JsMessage
A representation of a translatable message in JavaScript source code.
JsMessage.Builder
Contains functionality for creating JS messages.
JsMessage.IdGenerator
JsMessage.PlaceholderReference
A reference to a placeholder in a translatable message.
JsMessage.Style
Message style that could be used for JS code parsing.
JsMessageExtractor
Extracts messages and message comments from JS code.
JSModule
A JavaScript module has a unique name, consists of a list of compiler inputs, and can depend on other modules.
JSModuleGraph
A `JSModule` dependency graph that assigns a depth to each module and can answer depth-related queries about them.
JSModuleGraph.MissingModuleException
JSModuleGraph.ModuleDependenceException
JSSourceFile
Deprecated.
JSSourceFile is an empty wrapper around SourceFile.
LightweightMessageFormatter
Lightweight message formatter.
LoggerErrorManager
An error manager that logs errors and warnings using a logger in addition to collecting them in memory.
MessageBundle
An interface for providing alternative values for user-visible messages in JavaScript code.
MessageFormatter
Format warnings and errors.
NodeTraversal
NodeTraversal allows an iteration through the nodes in the parse tree, and facilitates the optimizations on the parse tree.
NodeTraversal.AbstractNodeTypePruningCallback
Abstract callback to visit a pruned set of nodes.
NodeTraversal.AbstractPostOrderCallback
Abstract callback to visit all nodes in post order.
NodeTraversal.AbstractScopedCallback
Abstract scoped callback to visit all nodes in post order.
NodeTraversal.AbstractShallowCallback
Abstract callback to visit all nodes but not traverse into function bodies.
NodeTraversal.AbstractShallowStatementCallback
Abstract callback to visit all structure and statement nodes but doesn't traverse into functions or expressions.
NodeTraversal.Callback
Callback
NodeTraversal.ScopedCallback
Callback that also knows about scope changes
NodeUtil
NodeUtil contains generally useful AST utilities.
ObjectPropertyStringPreprocess
Rewrites `new goog.testing.ObjectPropertyString(foo, 'bar')` to `new JSCompiler_ObjectPropertyString(window, foo.bar)`.
PassConfig
Pass factories and meta-data for native Compiler passes.
PassConfig.State
Intermediate state for a running pass configuration.
PassFactory
A factory for creating JSCompiler passes based on the Options injected.
PeepholeCollectPropertyAssignments
A pass that looks for assignments to properties of an object or array immediately following its creation using the abbreviated syntax.
PerformanceTracker
PerformanceTracker.Stats
For each pass, keep track of the runtime, the size changes, etc
PrintStreamErrorManager
An error manager that prints errors and warnings to the print stream provided in addition to the functionality of the `BasicErrorManager`.
ProcessCommonJSModules
Rewrites a CommonJS module http://wiki.commonjs.org/wiki/Modules/1.1.1 into a form that can be safely concatenated.
PropertyRenamingPolicy
Policies to determine how properties should be renamed.
Region
Source code region.
Result
Compilation results
Scope
Scope contains information about a variable scope in JavaScript.
Scope.Arguments
A special subclass of Var used to distinguish "arguments" in the current scope.
Scope.Var
Stores info about a variable
ShowByPathWarningsGuard
Control whether warnings should be restricted or suppressed for specified paths.
ShowByPathWarningsGuard.ShowType
Controls whether warnings should be restricted to a specified path or suppressed within the specified path.
SimpleRegion
Simple region.
SourceAst
An interface for accessing the AST root of an input.
SourceExcerptProvider
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.
SourceExcerptProvider.ExcerptFormatter
A excerpt formatter is responsible of formatting source excerpts.
SourceExcerptProvider.SourceExcerpt
Source excerpt variety.
SourceFile
An abstract representation of a source file that provides access to language-neutral features.
SourceFile.Builder
A builder interface for source files.
SourceFile.Generator
A JavaScript source code provider.
SourceMap
Collects information mapping the generated (compiled) source back to its original source for debugging purposes.
SourceMap.DetailLevel
Source maps can be very large different levels of detail can be specified.
SourceMap.Format
SourceMap.LocationMapping
StatementFusion
Tries to fuse all the statements in a block into a one statement by using COMMAs.
StrictWarningsGuard
All warnings should be reported as errors.
SymbolTable
A symbol table for people that want to use Closure Compiler as an indexer.
SymbolTable.Reference
SymbolTable.Symbol
SymbolTable.SymbolScope
SyntheticAst
An AST generated totally by the compiler.
TypeCheck
Checks the types of JS expressions against any declared type information.
VariableMap
Stores the mapping from original variable name to new variable names.
VariableRenamingPolicy
Policies to determine which variables should be renamed.
WarningLevel
Convert the warnings level to an Options object.
WarningsGuard
Class that allows to flexibly manage what to do with a reported warning/error.
WarningsGuard.Priority
WhitelistWarningsGuard
An extension of `WarningsGuard` that provides functionality to maintain a list of warnings (white-list).
WhitelistWarningsGuard.WhitelistBuilder
XtbMessageBundle
A MessageBundle that parses messages from an XML Translation Bundle (XTB) file.