Package | Description |
---|---|
com.google.javascript.jscomp |
Provides the core compiler and its public API.
|
com.google.javascript.jscomp.lint |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AliasStrings
A
Compiler pass for aliasing strings. |
private class |
AmbiguateProperties.ProcessProperties
Finds all property references, recording the types on which they occur.
|
private class |
AnalyzePrototypeProperties.ProcessExternProperties |
(package private) class |
AngularPass
Compiler pass for AngularJS-specific needs.
|
(package private) class |
AnonymousFunctionNamingCallback
Visitor that performs naming operations on anonymous functions by
means of the FunctionNamer interface.
|
private class |
ChainCalls.GatherCallSites |
(package private) class |
CheckDebuggerStatement
CheckDebuggerStatement checks for the presence of the "debugger"
statement in JavaScript code. |
private class |
CheckEventfulObjectDisposal.ComputeEventizeTraversal |
private class |
CheckEventfulObjectDisposal.Traversal |
(package private) class |
CheckJSDoc
Checks for misplaced, misused or deprecated JSDoc annotations.
|
(package private) class |
CheckMissingGetCssName
Ensures string literals matching certain patterns are only used as
goog.getCssName parameters.
|
(package private) class |
CheckRegExp
Look for references to the global RegExp object that would cause
regular expressions to be unoptimizable, and checks that regular expressions
are syntactically valid.
|
(package private) class |
CheckSideEffects
Checks for non side effecting statements such as
|
private class |
CheckSideEffects.GetNoSideEffectExterns
Get fully qualified function names which are marked
with @nosideeffects
TODO(ChadKillingsworth) Add support for object literals
|
(package private) static class |
CheckSideEffects.StripProtection
Remove side-effect sync functions.
|
(package private) class |
CheckSuspiciousCode
Checks for common errors, such as misplaced semicolons:
|
private class |
ClosureCodeRemoval.FindAbstractMethods
Identifies all assignments of the abstract method to a variable.
|
private class |
ClosureCodeRemoval.FindAssertionCalls
Identifies all assertion calls.
|
private class |
ClosureOptimizePrimitives.FindObjectCreateCalls
Identifies all calls to goog.object.create.
|
(package private) class |
ClosureRewriteClass
Rewrites "goog.defineClass" into a form that is suitable for
type checking and dead code elimination.
|
(package private) class |
CoalesceVariableNames
Reuse variable names if possible.
|
private class |
CollapseAnonymousFunctions.Callback |
private class |
CollapseVariableDeclarations.GatherCollapses
Gathers all of the variable declarations / assignments that should be
collapsed into one.
|
(package private) class |
ConstCheck
Verifies that constants are only assigned a value once.
|
(package private) class |
ConstParamCheck
Enforces that invocations of the method
goog.string.Const.from are
done with an argument which is a string literal. |
(package private) class |
ConvertToDottedProperties
Converts property accesses from quoted string syntax to dot syntax, where
possible.
|
(package private) class |
CoverageInstrumentationCallback
This class implements a traversal to instrument an AST for code coverage.
|
private class |
CreateSyntheticBlocks.Callback |
(package private) class |
DeadAssignmentsElimination
Removes local variable assignments that are useless based on information from
LiveVariablesAnalysis . |
(package private) class |
Es6RenameReferences
Renames references in code and JSDoc when necessary.
|
class |
Es6RenameVariablesInParamLists
Renames declarations and references in function bodies to avoid shadowing
names referenced in the parameter list, in default values or computed properties.
|
private class |
Es6RenameVariablesInParamLists.CollectReferences
Collects all references in a naive way.
|
class |
Es6RewriteBlockScopedDeclaration
Rewrite "let"s and "const"s as "var"s.
|
private class |
Es6RewriteBlockScopedDeclaration.CollectUndeclaredNames
Record undeclared names and aggressively rename possible references to them.
|
private class |
Es6RewriteBlockScopedDeclaration.LoopClosureTransformer
Transforms let/const declarations captured by loop closures.
|
private class |
Es6RewriteBlockScopedDeclaration.RewriteBlockScopedFunctionDeclaration |
class |
Es6RewriteGenerators
Converts ES6 generator functions to valid ES3 code.
|
class |
Es6SplitVariableDeclarations
Splits variable declarations that declare multiple variables into
separate declarations, if at least one of the declarations is a
destructuring declaration.
|
private class |
Es6ToEs3ClassSideInheritance.FindStaticMembers |
private class |
Es6ToEs3Converter.CheckClassAssignments |
(package private) class |
ExpandJqueryAliases
Replace known jQuery aliases and methods with standard
conventions so that the compiler recognizes them.
|
(package private) static class |
ExpandJqueryAliases.FindCallbackArgumentReferences
Given a jQuery.expandedEach callback function, traverse it and collect any
references to its parameter names.
|
(package private) class |
ExternExportsPass
Creates an externs file containing all exported symbols and properties
for later consumption.
|
(package private) class |
FindExportableNodes
Records all of the symbols and properties that should be exported.
|
(package private) class |
FlowSensitiveInlineVariables
Inline variables when possible.
|
private static class |
FunctionNames.FunctionListExtractor |
(package private) class |
GatherExternProperties
Gathers property names defined in externs.
|
(package private) class |
GatherRawExports
External references of the form: "window['xx']" indicate names that must
be reserved when variable renaming to avoid conflicts.
|
class |
ImplicitNullabilityCheck
Warn about types in JSDoc that are implicitly nullable.
|
(package private) class |
InferJSDocInfo
Set the JSDocInfo on all types.
|
private class |
InlineAliases.AliasesCollector |
private class |
InlineAliases.AliasesInliner |
private static class |
InlineFunctions.CallVisitor
Visit call sites for functions in functionMap.
|
private class |
InlineFunctions.FindCandidatesReferences
Find references to functions that are inlinable.
|
(package private) class |
InlineProperties.GatherCandidates |
(package private) class |
InlineProperties.ReplaceCandidates |
private class |
InlineSimpleMethods.InlineTrivialAccessors
For each method call, see if it is a candidate for inlining.
|
private class |
InstrumentFunctions.InstrumentCallback |
private static class |
InstrumentFunctions.RemoveCallback
The application must refer to these variables to output them so the
application must also declare these variables for the first
VarCheck pass. |
(package private) class |
InvocationsCallback
Traversal callback that finds method invocations of the form
|
private class |
J2clPass.ClassStaticFunctionsInliner.StaticCallInliner |
private class |
J2clPropertyInlinerPass.StaticFieldGetterSetterInliner.DetermineInlinableProperties |
private class |
J2clPropertyInlinerPass.StaticFieldGetterSetterInliner.GatherJ2CLClassGetterSetters
This class traverses the ast and gathers get and set methods contained in
Object.defineProperties nodes.
|
private class |
J2clPropertyInlinerPass.StaticFieldGetterSetterInliner.InlinePropertiesPass
Look for accesses of j2cl properties and assignments to j2cl properties.
|
class |
JsdocToEs6TypedConverter
Converts JS with types in jsdocs to an extended JS syntax that includes types.
|
private class |
JsMessageExtractor.ExtractMessagesVisitor
Visitor that collects messages.
|
class |
JsMessageVisitor
Traverses across parsed tree and finds I18N messages.
|
private class |
MarkNoSideEffectCalls.GatherNoSideEffectFunctions
Gather function nodes that have @nosideeffects annotations.
|
private class |
MarkNoSideEffectCalls.SetNoSideEffectCallProperty
Set the no side effects property for CALL and NEW nodes that
refer to function names that are known to have no side effects.
|
private class |
MethodCompilerPass.GatherSignatures
Gather signatures from the source to be compiled.
|
private class |
MethodCompilerPass.GetExternMethods
Gathers methods from the externs file.
|
(package private) class |
MinimizeExitPoints
Transform the structure of the AST so that the number of explicit exits
are minimized and instead flows to implicit exits conditions.
|
private class |
NameAnalyzer.FindDeclarationsAndSetters
Identifies all declarations of global names and setter statements
affecting global symbols (assignments to global names).
|
private class |
NameAnalyzer.FindDependencyScopes
Identifies all dependency scopes.
|
private class |
NameAnalyzer.ProcessExternals
Walk through externs and mark nodes as externally declared if declared
|
private static class |
Normalize.FindExposeAnnotations
Find all the @expose annotations.
|
(package private) static class |
Normalize.PropagateConstantAnnotationsOverVars
Propagate constant annotations over the Var graph.
|
private class |
Normalize.RewriteExposedProperties
Rewrite all exposed properties in [] form.
|
(package private) static class |
Normalize.VerifyConstants
Walk the AST tree and verify that constant names are used consistently.
|
private class |
ObjectLitAssignmentShortening.ObjectLitShorteningCallback |
private class |
ObjectPropertyStringPostprocess.Callback |
private class |
ObjectPropertyStringPreprocess.Callback |
(package private) class |
PolymerPass
Rewrites "Polymer({})" calls into a form that is suitable for type checking and dead code
elimination.
|
(package private) class |
PolymerPassFindExterns
Finds the externs for the PolymerElement base class and all of its properties in the externs.
|
(package private) class |
PolymerPassSuppressBehaviors
For every Polymer Behavior, strip property type annotations and add suppress checktypes on
functions.
|
(package private) static class |
PrepareAst.PrepareAnnotations
Normalize where annotations appear on the AST.
|
(package private) class |
ProcessClosurePrimitives
Replaces goog.provide calls, removes goog.require calls, verifies that
goog.require has a corresponding goog.provide and some closure specific
simplifications.
|
private class |
ProcessCommonJSModules.ProcessCommonJsModulesCallback
Visits require, every "script" and special module.exports assignments.
|
private class |
ProcessCommonJSModules.SuffixVarsCallback
Traverses a node tree and appends a suffix to all global variable names.
|
class |
ProcessEs6Modules
Rewrites a ES6 module into a form that can be safely concatenated.
|
private class |
ProcessEs6Modules.RenameGlobalVars
Traverses a node tree and
Appends a suffix to all global variable names defined in this module.
|
private class |
ProcessTweaks.CollectTweaks
Processes all calls to goog.tweak functions.
|
(package private) class |
RecordFunctionInformation
Records information about functions and modules.
|
private class |
RenameProperties.ProcessProperties
A traversal callback that collects property names and counts how
frequently each property name occurs.
|
(package private) class |
RenameVars.ProcessVars
Iterate through the nodes, collect all the NAME nodes that need to be
renamed, and count how many times each variable name is referenced.
|
private class |
ReplaceCssNames.Traversal |
private class |
ReplaceIdGenerators.GatherGenerators |
private class |
ReplaceIdGenerators.ReplaceGenerators |
(package private) class |
ReplaceMessages
ReplaceMessages replaces user-visible messages with alternatives.
|
(package private) class |
ReplaceMessagesForChrome
Replaces user-visible messages with appropriate calls to
chrome.i18n.getMessage.
|
(package private) class |
ReplaceStrings
Replaces JavaScript strings in the list of supplied methods with shortened
forms.
|
private class |
RescopeGlobalSymbols.FindCrossModuleNamesCallback
Find all global names that are used in more than one module.
|
private class |
RescopeGlobalSymbols.FindNamesReferencingThis
Builds the maybeReferencesThis set of names that may reference a function
that references this.
|
private class |
RescopeGlobalSymbols.MakeExternsReferenceWindowExplicitly
Rewrites extern names to be explicit children of window instead of only
implicitly referencing it.
|
private class |
RescopeGlobalSymbols.RewriteScopeCallback
Visits each NAME token and checks whether it refers to a global variable.
|
(package private) class |
RewriteBindThis
Rewrite .bind(this) calls on an anonymous functions to arrow functions
(which have implicit this binding).
|
private class |
RewritePolyfills.Traverser |
private class |
RuntimeTypeCheck.AddChecks
Insert calls to the run-time type checking function
checkType , which
takes an expression to check and a list of checkers (one of which must
match). |
private static class |
RuntimeTypeCheck.AddMarkers
Inserts marker properties for user-defined interfaces and classes.
|
private class |
ScopedAliases.Traversal |
private class |
ShadowVariables.DoShadowVariables |
private class |
ShadowVariables.GatherReferenceInfo |
private class |
SimpleDefinitionFinder.UseSiteGatheringCallback |
(package private) class |
SourceInformationAnnotator
Annotates nodes with information from their original input file
before the compiler performs work that changes this information (such
as its original location, its original name, etc).
|
(package private) class |
StrictModeCheck
Checks that the code obeys the static restrictions of strict mode:
No use of "with".
|
private static class |
StrictModeCheck.NonExternChecks
Checks that are performed on non-extern code only.
|
private class |
StripCode.Strip
A callback that strips debug code from a JavaScript parse tree.
|
(package private) class |
SubstituteEs6Syntax
An optimization that does peephole optimizations of ES6 code.
|
private class |
SymbolTable.JSDocInfoCollector
Collects references to types in JSDocInfo.
|
private class |
SymbolTable.PropertyRefCollector |
private class |
SymbolTable.VisibilityCollector
Collects the visibility information for each name/property.
|
private static class |
TransformAMDToCJSModule.RenameCallback
Renames names;
|
private class |
TransformAMDToCJSModule.TransformAMDModulesCallback
Rewrites calls to define which has to be in void context just below the
current script node.
|
(package private) class |
VarCheck
Checks that all variables are declared, that file-private variables are
accessed only in the file that declares them, and that any var references
that cross module boundaries respect declared module dependencies.
|
private class |
VarCheck.NameRefInExternsCheck
A check for name references in the externs inputs.
|
Modifier and Type | Class and Description |
---|---|
class |
CheckDuplicateCase
Check for duplicate case labels in a switch statement
Eg:
switch (foo) {
case 1:
case 1:
}
This is normally an indication of a programmer error.
|
class |
CheckEmptyStatements
Check for empty statements (i.e.
|
class |
CheckEnums
Check for duplicate values in enums.
|
class |
CheckForInOverArray
Checks when the pattern for (x in arr) { ...
|
class |
CheckInterfaces
Checks for errors related to interfaces.
|
class |
CheckJSDocStyle
Checks for various JSDoc-related style issues, such as function definitions without JsDoc, params
with no corresponding
@param annotation, coding conventions not being respected, etc. |