Class CompilerOptions
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
A mode enum used to indicate the alias strings policy for the AliasStrings passstatic interface
A Role Specific Interface for the JS Compiler to report aliases used to change the code during a compile.static interface
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.static enum
Format for compiler output when multiple chunks are requested.static enum
When to do the extra validity checksstatic enum
An environment specifies the built-in externs that are loaded for a given compilation.static enum
How ES modules should be transformed.static enum
Options to force transpile specific features for performance experiments.static enum
static enum
static enum
An option to determine what level of code instrumentation is performed, if anystatic enum
What kind of isolation is going to be usedstatic enum
A mode enum used to indicate whether J2clPass should be enabled, disabled, or enabled automatically if there is any J2cl source file (i.e.static enum
A language mode applies to the whole compilation job.static enum
What type of JS file should be output by this compilationstatic enum
static enum
A common enum for compiler passes that can run either globally or locally.static enum
How much tracing we want to dostatic enum
Option for the ProcessTweaks pass -
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
Checks for suspicious statements that have no effectboolean
Checks that all symbols are definedboolean
Checks types on expressionsboolean
Processes goog.provide() and goog.require() callsboolean
Merge two variables together as one.boolean
Collapses anonymous function declarations into named function declarationsboolean
Collapses multiple variable declarations into oneboolean
Use @nosideeffects annotations, function bodies and name graph to determine if calls have side effects.boolean
Converts quoted property accesses to dot syntax (a['b'] → a.b)@Nullable CssRenamingMap
Map used in the renaming of CSS class names.protected @Nullable com.google.common.collect.Multimap
<CustomPassExecutionTime, CompilerPass> Custom passesboolean
Remove assignments to values that can not be referencedboolean
Devirtualize prototype method by rewriting them to be static calls that take the this pointer as their first argumentboolean
Whether to export test functions.boolean
boolean
Folds constants (e.g.boolean
Gather CSS names (requires closurePass)boolean
boolean
Generate pseudo names for variables and properties for debugging purposes.boolean
To distinguish between gents and non-gents mode so that we can turn off checking the sanity of the source location of comments, and also provide a different mode for comment printing between those two.boolean
Inlines constants (symbols that are all CAPS)boolean
Inlines variablesThe string to use as the separator for printInputDelimiterboolean
Controls label renaming.boolean
Line break the output a bit more aggressively@Nullable String
Compiling localeboolean
Sets the special "COMPILED" value to true@Nullable MessageBundle
Returns localized replacement for MSG_* variablesboolean
Remove unused function arguments, remove unused return values, and inlines constant parameters.boolean
Do not strip closure-style type annotations from code.boolean
Prints a separator comment before each JS scriptboolean
Removes unused member propertiesboolean
Removes unused variables in local scope.boolean
Removes unused member prototypesboolean
Removes unused variables@Nullable String
Specifies a prefix for all globalsSpecifies the name of an object that will be used to store all non-extern globals.boolean
Reserve property names on the global this object.boolean
Reduces the size of common function expressions.boolean
Move top-level function declarations to the topboolean
Removes code associated with unused global namesThe detail level for the generated source map.The source map file formatList
<? extends SourceMap.LocationMapping> @Nullable String
@Nullable String
Controls which variables get renamed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCustomPass
(CustomPassExecutionTime time, CompilerPass customPass) void
addWarningsGuard
(WarningsGuard guard) Add a guard to the set of warnings guards.boolean
boolean
void
boolean
boolean
static com.google.common.collect.ImmutableSet
<Character> boolean
boolean
boolean
boolean
final com.google.common.collect.ImmutableList
<com.google.javascript.jscomp.ConformanceConfig> com.google.common.base.Optional
<Pattern> @Nullable Path
Returns the map of define replacements.Set the alias name for dynamic import expressions@Nullable String
com.google.common.collect.ImmutableList
<CompilerOptions.ExperimentalForceTranspile> @Nullable String
boolean
Gets the inferTypes flag.Get the function inlining policy for the compiler.boolean
boolean
boolean
int
boolean
boolean
Gets the set of features that can appear in the output.boolean
com.google.common.collect.ImmutableSet
<String> char[]
char[]
boolean
boolean
com.google.common.collect.ImmutableSet
<String> Deprecated.StripCode is deprecated.@Nullable com.google.common.collect.ImmutableSet
<String> boolean
@Nullable Pattern
boolean
Checks JSDoc documentation will be parsed.boolean
boolean
boolean
boolean
void
legacySetOutputFeatureSet
(FeatureSet featureSet) boolean
needsTranspilationFrom
(FeatureSet languageLevel) boolean
needsTranspilationOf
(FeatureSet.Feature feature) void
Reset the warnings guard.void
setAliasStringsMode
(CompilerOptions.AliasStringsMode aliasStringsMode) void
void
setAllowDynamicImport
(boolean value) Whether to enable support for dynamic import expressionsvoid
setAlwaysGatherSourceMapInfo
(boolean shouldAlwaysGatherSourceMapInfo) void
setAmbiguateProperties
(boolean ambiguateProperties) void
setAngularPass
(boolean angularPass) void
setApplyInputSourceMaps
(boolean applyInputSourceMaps) void
setAssumeClosuresOnlyCaptureReferences
(boolean enable) Whether to assume closures capture only what they reference.void
setAssumeForwardDeclaredForMissingTypes
(boolean assumeForwardDeclaredForMissingTypes) Iftrue
, considers all missing types to be forward declared (useful for partial compilation).void
setAssumeGettersArePure
(boolean x) void
setAssumeStaticInheritanceIsNotUsed
(boolean x) void
setAssumeStrictThis
(boolean enable) If true, enables enables additional optimizations.void
Whether to enable the bad module rewriting before typechecking that we want to get rid ofvoid
setBrowserFeaturesetYear
(int year) void
setBrowserFeaturesetYear
(com.google.javascript.jscomp.CompilerOptions.BrowserFeaturesetYear year) void
setBrowserResolverPrefixReplacements
(com.google.common.collect.ImmutableMap<String, String> browserResolverPrefixReplacements) void
setCheckDeterminism
(boolean checkDeterminism) void
Deprecated.void
setChecksOnly
(boolean checksOnly) void
setCheckSuspiciousCode
(boolean checkSuspiciousCode) void
setCheckSymbols
(boolean checkSymbols) void
setCheckTypes
(boolean checkTypes) void
setChromePass
(boolean chromePass) void
setChunkIdHashFunction
(Xid.HashFunction chunkIdHashFunction) Sets the hash function to use for chunk ID generationvoid
setChunkOutputType
(CompilerOptions.ChunkOutputType chunkOutputType) void
setChunksToPrintAfterEachPassRegexList
(List<String> chunkPathRegexList) void
setClosurePass
(boolean closurePass) void
setCoalesceVariableNames
(boolean coalesceVariableNames) void
setCodingConvention
(CodingConvention codingConvention) void
setCollapseAnonymousFunctions
(boolean enabled) void
setCollapseObjectLiterals
(boolean enabled) void
setCollapseProperties
(boolean fullyCollapse) Deprecated.void
void
setCollapseVariableDeclarations
(boolean enabled) void
setColorizeErrorOutput
(boolean colorizeErrorOutput) void
setCommonJSModulePathPrefix
(String commonJSModulePathPrefix) Sets a path prefix for CommonJS modules (maps tosetModuleRoots(List)
).void
setComputeFunctionSideEffects
(boolean computeFunctionSideEffects) void
setConformanceConfig
(com.google.javascript.jscomp.ConformanceConfig conformanceConfig) Deprecated.See go/binary-level-conformance-deprecated.void
setConformanceConfigs
(List<com.google.javascript.jscomp.ConformanceConfig> configs) Deprecated.See go/binary-level-conformance-deprecated.void
setConformanceRemoveRegexFromPath
(com.google.common.base.Optional<Pattern> pattern) void
setContinueAfterErrors
(boolean continueAfterErrors) void
setConvertToDottedProperties
(boolean convertToDottedProperties) void
setCrossChunkCodeMotion
(boolean crossChunkCodeMotion) void
setCrossChunkCodeMotionNoStubMethods
(boolean crossChunkCodeMotionNoStubMethods) void
setCrossChunkMethodMotion
(boolean crossChunkMethodMotion) void
setCssRenamingMap
(CssRenamingMap cssRenamingMap) void
setCssRenamingSkiplist
(Set<String> skiplist) void
setDeadAssignmentElimination
(boolean deadAssignmentElimination) void
setDebugLogDirectory
(@Nullable Path dir) void
setDebugLogFilter
(String filter) void
setDefineReplacements
(Map<String, Object> defineReplacements) void
setDefineToBooleanLiteral
(String defineName, boolean value) Sets the value of the@define
variable in JS to a boolean literal.void
setDefineToDoubleLiteral
(String defineName, double value) Sets the value of the@define
variable in JS to a number literal.void
setDefineToNumberLiteral
(String defineName, int value) Sets the value of the@define
variable in JS to a number literal.void
setDefineToStringLiteral
(String defineName, String value) Sets the value of the@define
variable in JS to a String literal.void
setDependencyOptions
(DependencyOptions dependencyOptions) Sets the dependency management options.void
setDevirtualizeMethods
(boolean devirtualizeMethods) void
setDevMode
(CompilerOptions.DevMode devMode) void
setDiagnoseAsyncContextSafariCrash
(boolean diagnose) Sets whether to diagnose the Safari crash in async context instrumentation.void
setDisambiguateProperties
(boolean disambiguateProperties) void
setDoLateLocalization
(boolean doLateLocalization) void
setDynamicImportAlias
(String value) Set the alias name for dynamic import expressionssetEmitUseStrict
(boolean emitUseStrict) void
setEnableModuleRewriting
(boolean enable) Experimental option to disable all Closure and ES module and goog.provide rewritingvoid
setEnableZonesDefineName
(@Nullable String enableZonesDefineName) void
setEnvironment
(CompilerOptions.Environment environment) Set which set of builtin externs to use.void
setErrorFormat
(ErrorFormat errorFormat) void
setErrorHandler
(ErrorHandler handler) Set a custom handler for warnings and errors.void
void
setExperimentalForceTranspiles
(CompilerOptions.ExperimentalForceTranspile... experimentalForceTranspile) void
setExportLocalPropertyDefinitions
(boolean export) void
setExportTestFunctions
(boolean exportTestFunctions) void
setExternExportsPath
(@Nullable String externExportsPath) void
setExtraAnnotationNames
(Iterable<String> extraAnnotationNames) void
setExtractPrototypeMemberDeclarations
(boolean enabled) void
void
setFilesToPrintAfterEachPassRegexList
(List<String> filePathRegexList) void
setFlowSensitiveInlineVariables
(boolean enabled) void
setFoldConstants
(boolean foldConstants) void
setForceLibraryInjection
(Iterable<String> libraries) Sets list of libraries to always inject, even if not needed.void
setGatherCssNames
(boolean gatherCssNames) void
setGenerateExports
(boolean generateExports) void
setGeneratePseudoNames
(boolean generatePseudoNames) void
setGentsMode
(boolean gentsMode) void
setIdGenerators
(Map<String, RenamingMap> idGenerators) Sets the id generators to replace.void
setIdGenerators
(Set<String> idGenerators) Sets the id generators to replace.void
setIdGeneratorsMap
(String previousMappings) A previous map of ids (serialized to a string by a previous compile).void
void
setInferConst
(boolean value) void
setInferTypes
(boolean enable) If true, enables type inference.void
setInjectPolyfillsNewerThan
(CompilerOptions.LanguageMode injectPolyfillsNewerThan) void
setInlineConstantVars
(boolean inlineConstantVars) void
Set the function inlining policy for the compiler.void
setInlineLocalVariables
(boolean inlineLocalVariables) void
setInlineProperties
(boolean enable) Set the function inlining policy for the compiler.void
setInlineVariables
(boolean inlineVariables) void
Set the variable inlining policy for the compiler.void
setInputDelimiter
(String inputDelimiter) void
setInputPropertyMap
(VariableMap inputPropertyMap) void
setInputSourceMaps
(com.google.common.collect.ImmutableMap<String, SourceMapInput> inputSourceMaps) Sets the input sourcemap files, indexed by the JS files they refer to.void
setInputVariableMap
(VariableMap inputVariableMap) void
setInstrumentAsyncContext
(boolean instrumentAsyncContext) Sets whether to transpile async functions and generators for AsyncContext.void
setInstrumentForCoverageOnly
(boolean instrumentForCoverageOnly) void
setInstrumentForCoverageOption
(CompilerOptions.InstrumentOption instrumentForCoverageOption) void
setIsolatePolyfills
(boolean isolatePolyfills) Sets whether to isolate polyfills from the global scope.void
setJ2clMinifierEnabled
(boolean enabled) void
setJ2clMinifierPruningManifest
(String j2clMinifierPruningManifest) void
setJ2clPass
(CompilerOptions.J2clPassMode j2clPassMode) void
setLabelRenaming
(boolean labelRenaming) void
setLanguage
(CompilerOptions.LanguageMode language) Sets ECMAScript version to use.void
setLanguageIn
(CompilerOptions.LanguageMode languageIn) Sets ECMAScript version to use for the input.void
setLanguageOut
(CompilerOptions.LanguageMode languageOut) Sets ECMAScript version to use for the output.void
setLineBreak
(boolean lineBreak) void
setLineLengthThreshold
(int lineLengthThreshold) void
void
setMarkAsCompiled
(boolean markAsCompiled) void
setMaxFunctionSizeAfterInlining
(int funAstSize) void
setMaxOptimizationLoopIterations
(int maxIterations) void
setMessageBundle
(MessageBundle messageBundle) void
setModuleResolutionMode
(ModuleLoader.ResolutionMode moduleResolutionMode) void
setModuleRoots
(List<String> moduleRoots) Sets the module roots.void
setNameGenerator
(NameGenerator nameGenerator) void
setNewTypeInference
(boolean enable) Deprecated.This is a no-op.void
setNumParallelThreads
(int parallelism) Sets the level of parallelism for compilation passes that can exploit multi-threading.void
setOptimizeCalls
(boolean optimizeCalls) void
setOptimizeESClassConstructors
(boolean optimizeESClassConstructors) void
setOutputCharset
(Charset charset) Sets the output charset.void
setOutputJs
(CompilerOptions.OutputJs outputJs) void
setOutputJsStringUsage
(boolean outputJsStringUsage) void
setPackageJsonEntryNames
(List<String> names) void
setParentChunkCanSeeSymbolsDeclaredInChildren
(boolean parentChunkCanSeeSymbolsDeclaredInChildren) void
setParseInlineSourceMaps
(boolean parseInlineSourceMaps) void
setParseJsDocDocumentation
(Config.JsDocParsing parseJsDocDocumentation) Enables or disables the parsing of JSDoc documentation, and optionally also the preservation of all whitespace and formatting within a JSDoc comment.void
setPathEscaper
(ModuleLoader.PathEscaper pathEscaper) void
setPolymerVersion
(Integer polymerVersion) void
setPreferSingleQuotes
(boolean enabled) Normally, when there are an equal number of single and double quotes in a string, the compiler will use double quotes.void
setPreferStableNames
(boolean preferStableNames) void
setPreserveClosurePrimitives
(boolean preserveClosurePrimitives) Preserve closure primitives.void
setPreserveDetailedSourceInfo
(boolean preserveDetailedSourceInfo) void
setPreserveNonJSDocComments
(boolean preserveNonJSDocComments) void
setPreserveTypeAnnotations
(boolean preserveTypeAnnotations) void
setPrettyPrint
(boolean prettyPrint) void
setPreventLibraryInjection
(boolean preventLibraryInjection) Sets the set of libraries to never inject, even if required.void
setPrintConfig
(boolean printConfig) Should the compiler print its configuration options to stderr when they are initialized?void
setPrintInputDelimiter
(boolean printInputDelimiter) void
setPrintSourceAfterEachPass
(boolean printSource) void
setProcessCommonJSModules
(boolean processCommonJSModules) Rewrites CommonJS modules so that modules can be concatenated together, by renaming all globals to avoid conflicting with other modules.void
setProductionInstrumentationArrayName
(String productionInstrumentationArrayName) Sets the name for the global array which is used by PRODUCTION instrumentation.void
Sets the list of properties that we report property invalidation errors for.void
setPropertyRenaming
(PropertyRenamingPolicy propertyRenaming) void
setPropertyRenamingOnlyCompilationMode
(boolean propertyRenamingOnlyCompilationMode) void
setProtectHiddenSideEffects
(boolean enable) When enabled, assume that apparently side-effect free code is meaningful.void
setQnameUsesToPrintAfterEachPassList
(List<String> qnameRegexList) void
setQuoteKeywordProperties
(boolean quoteKeywordProperties) void
setRemoveAbstractMethods
(boolean remove) void
setRemoveClosureAsserts
(boolean remove) void
setRemoveJ2clAsserts
(boolean remove) void
setRemoveUnusedClassProperties
(boolean removeUnusedClassProperties) void
setRemoveUnusedPrototypeProperties
(boolean enabled) void
Set the variable removal policy for the compiler.void
setRenamePrefix
(String renamePrefix) void
setRenamePrefixNamespace
(String renamePrefixNamespace) void
setRenamePrefixNamespaceAssumeCrossChunkNames
(boolean assume) Useful for tests to avoid having to declare two chunksvoid
setRenamingPolicy
(VariableRenamingPolicy newVariablePolicy, PropertyRenamingPolicy newPropertyPolicy) Sets the variable and property renaming policies for the compiler, in a way that clears warnings about the renaming policy being uninitialized from flags.void
setReplaceIdGenerators
(boolean replaceIdGenerators) void
setReplaceMessagesWithChromeI18n
(boolean replaceMessagesWithChromeI18n, String tcProjectId) void
setReplaceStringsConfiguration
(String placeholderToken, List<String> functionDescriptors) Sets the functions whose debug strings to replace.void
setReplaceStringsFunctionDescriptions
(List<String> replaceStringsFunctionDescriptions) void
setReplaceStringsPlaceholderToken
(String replaceStringsPlaceholderToken) void
setReserveRawExports
(boolean reserveRawExports) void
setResolveSourceMapAnnotations
(boolean resolveSourceMapAnnotations) void
setRewriteFunctionExpressions
(boolean rewriteFunctionExpressions) void
setRewriteGlobalDeclarationsForTryCatchWrapping
(boolean rewrite) void
setRewritePolyfills
(boolean rewritePolyfills) Sets whether to rewrite polyfills.void
setSkipNonTranspilationPasses
(boolean skipNonTranspilationPasses) Skip all passes (other than transpilation, if requested).void
setSkipTranspilationAndCrash
(boolean value) Deprecated.void
setSmartNameRemoval
(boolean smartNameRemoval) void
setSourceMapDetailLevel
(SourceMap.DetailLevel sourceMapDetailLevel) void
setSourceMapFormat
(SourceMap.Format sourceMapFormat) void
setSourceMapIncludeSourcesContent
(boolean sourceMapIncludeSourcesContent) void
setSourceMapLocationMappings
(List<? extends SourceMap.LocationMapping> sourceMapLocationMappings) void
setSourceMapOutputPath
(String sourceMapOutputPath) void
setStrictMessageReplacement
(boolean strictMessageReplacement) setStrictModeInput
(boolean isStrictModeInput) void
setStripNamePrefixes
(Set<String> stripNamePrefixes) Deprecated.StripCode is deprecated.void
setStripNameSuffixes
(Set<String> stripNameSuffixes) Deprecated.StripCode is deprecated.void
setStripTypes
(Set<String> stripTypes) Deprecated.StripCode is deprecated.void
setSummaryDetailLevel
(int summaryDetailLevel) Controls how detailed the compilation summary is.void
setSyntheticBlockEndMarker
(String syntheticBlockEndMarker) void
setSyntheticBlockStartMarker
(String syntheticBlockStartMarker) void
void
setTracerOutput
(Path out) void
setTrustedStrings
(boolean yes) Some people want to put arbitrary user input into strings, which are then run through the compiler.void
setTweakProcessing
(CompilerOptions.TweakProcessing tweakProcessing) Sets how goog.tweak calls are processed.void
setTypedAstOutputFile
(@Nullable Path file) Sets file to output in-progress TypedAST format to.void
setUnusedImportsToRemove
(@Nullable com.google.common.collect.ImmutableSet<String> unusedImportsToRemove) void
setUseOriginalNamesInOutput
(boolean useOriginalNamesInOutput) void
setUseSizeHeuristicToStopOptimizationLoop
(boolean mayStopEarly) void
setUseTypesForLocalOptimization
(boolean useTypesForLocalOptimization) void
setUseTypesForOptimization
(boolean useTypesForOptimization) Deprecated.void
setVariableRenaming
(VariableRenamingPolicy variableRenaming) void
setWarningLevel
(DiagnosticGroup type, CheckLevel level) Configure the given type of warning to the given level.void
setWarningsGuard
(ComposeWarningsGuard warningsGuard) void
setWrapGoogModulesForWhitespaceOnly
(boolean enable) void
setXidHashFunction
(Xid.HashFunction xidHashFunction) Sets the hash function to use for Xidvoid
setZoneInputPattern
(@Nullable Pattern zoneInputPattern) boolean
boolean
Deprecated.use getPropertyCollapseLevelboolean
boolean
boolean
Whether the output should contain a 'use strict' directive.boolean
boolean
boolean
boolean
boolean
Do not process goog.boolean
boolean
boolean
Whether or not the compiler should wrap apparently side-effect free code to prevent it from being removedboolean
boolean
boolean
boolean
Should we run the pass that does replacement of the chrome-specific `chrome.i18n.getMessage()` translatable message definitions?boolean
Should we run any form of the `ReplaceMessages` pass?boolean
boolean
void
Skip all possible passes, to make the compiler as fast as possible.toString()
-
Field Details
-
messageBundle
Returns localized replacement for MSG_* variables -
checkSymbols
public boolean checkSymbolsChecks that all symbols are defined -
checkSuspiciousCode
public boolean checkSuspiciousCodeChecks for suspicious statements that have no effect -
checkTypes
public boolean checkTypesChecks types on expressions -
foldConstants
public boolean foldConstantsFolds constants (e.g. (2 + 3) to 5) -
deadAssignmentElimination
public boolean deadAssignmentEliminationRemove assignments to values that can not be referenced -
inlineConstantVars
public boolean inlineConstantVarsInlines constants (symbols that are all CAPS) -
coalesceVariableNames
public boolean coalesceVariableNamesMerge two variables together as one. -
inlineVariables
public boolean inlineVariablesInlines variables -
flowSensitiveInlineVariables
public boolean flowSensitiveInlineVariables -
smartNameRemoval
public boolean smartNameRemovalRemoves code associated with unused global names -
removeUnusedPrototypeProperties
public boolean removeUnusedPrototypePropertiesRemoves unused member prototypes -
removeUnusedClassProperties
public boolean removeUnusedClassPropertiesRemoves unused member properties -
removeUnusedVars
public boolean removeUnusedVarsRemoves unused variables -
removeUnusedLocalVars
public boolean removeUnusedLocalVarsRemoves unused variables in local scope. -
collapseVariableDeclarations
public boolean collapseVariableDeclarationsCollapses multiple variable declarations into one -
collapseAnonymousFunctions
public boolean collapseAnonymousFunctionsCollapses anonymous function declarations into named function declarations -
convertToDottedProperties
public boolean convertToDottedPropertiesConverts quoted property accesses to dot syntax (a['b'] → a.b) -
rewriteFunctionExpressions
public boolean rewriteFunctionExpressionsReduces the size of common function expressions. -
optimizeCalls
public boolean optimizeCallsRemove unused function arguments, remove unused return values, and inlines constant parameters. -
variableRenaming
Controls which variables get renamed. -
labelRenaming
public boolean labelRenamingControls label renaming. -
reserveRawExports
public boolean reserveRawExportsReserve property names on the global this object. -
generatePseudoNames
public boolean generatePseudoNamesGenerate pseudo names for variables and properties for debugging purposes. -
renamePrefix
Specifies a prefix for all globals -
renamePrefixNamespace
Specifies the name of an object that will be used to store all non-extern globals. -
devirtualizeMethods
public boolean devirtualizeMethodsDevirtualize prototype method by rewriting them to be static calls that take the this pointer as their first argument -
computeFunctionSideEffects
public boolean computeFunctionSideEffectsUse @nosideeffects annotations, function bodies and name graph to determine if calls have side effects. -
exportTestFunctions
public boolean exportTestFunctionsWhether to export test functions. -
syntheticBlockStartMarker
-
syntheticBlockEndMarker
-
locale
Compiling locale -
markAsCompiled
public boolean markAsCompiledSets the special "COMPILED" value to true -
closurePass
public boolean closurePassProcesses goog.provide() and goog.require() calls -
gatherCssNames
public boolean gatherCssNamesGather CSS names (requires closurePass) -
customPasses
protected transient @Nullable com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPassesCustom passes -
rewriteGlobalDeclarationsForTryCatchWrapping
public boolean rewriteGlobalDeclarationsForTryCatchWrappingMove top-level function declarations to the top -
generateExports
public boolean generateExports -
cssRenamingMap
Map used in the renaming of CSS class names. -
preserveTypeAnnotations
public boolean preserveTypeAnnotationsDo not strip closure-style type annotations from code. -
gentsMode
public boolean gentsModeTo distinguish between gents and non-gents mode so that we can turn off checking the sanity of the source location of comments, and also provide a different mode for comment printing between those two. -
lineBreak
public boolean lineBreakLine break the output a bit more aggressively -
printInputDelimiter
public boolean printInputDelimiterPrints a separator comment before each JS script -
inputDelimiter
The string to use as the separator for printInputDelimiter -
errorFormat
-
sourceMapDetailLevel
The detail level for the generated source map. -
sourceMapFormat
The source map file format -
sourceMapLocationMappings
-
-
Constructor Details
-
CompilerOptions
public CompilerOptions()Initializes compiler options. All options are disabled by default.Command-line frontends to the compiler should set these properties like a builder.
-
-
Method Details
-
getAngularPropertyReservedFirstChars
public static com.google.common.collect.ImmutableSet<Character> getAngularPropertyReservedFirstChars() -
shouldRunCrossChunkCodeMotion
public boolean shouldRunCrossChunkCodeMotion() -
shouldRunCrossChunkMethodMotion
public boolean shouldRunCrossChunkMethodMotion() -
getSourceMapOutputPath
-
shouldGatherSourceMapInfo
public boolean shouldGatherSourceMapInfo() -
setAlwaysGatherSourceMapInfo
public void setAlwaysGatherSourceMapInfo(boolean shouldAlwaysGatherSourceMapInfo) -
setBrowserFeaturesetYear
public void setBrowserFeaturesetYear(int year) -
setBrowserFeaturesetYear
public void setBrowserFeaturesetYear(com.google.javascript.jscomp.CompilerOptions.BrowserFeaturesetYear year) -
setInstrumentForCoverageOnly
public void setInstrumentForCoverageOnly(boolean instrumentForCoverageOnly) -
getInstrumentForCoverageOnly
public boolean getInstrumentForCoverageOnly() -
setTypedAstOutputFile
Sets file to output in-progress TypedAST format to. DO NOT USE!The "TypedAST format" is currently a gzipped TypedAst proto but this is not stable.
-
getMergedPrecompiledLibraries
public boolean getMergedPrecompiledLibraries() -
setSkipTranspilationAndCrash
Deprecated. -
setInputSourceMaps
public void setInputSourceMaps(com.google.common.collect.ImmutableMap<String, SourceMapInput> inputSourceMaps) Sets the input sourcemap files, indexed by the JS files they refer to.- Parameters:
inputSourceMaps
- the collection of input sourcemap files
-
setInferConst
public void setInferConst(boolean value) -
setIncrementalChecks
-
shouldGenerateTypedExterns
public boolean shouldGenerateTypedExterns() -
shouldRunTypeSummaryChecksLate
public boolean shouldRunTypeSummaryChecksLate() -
setCheckGlobalThisLevel
Deprecated.Deprecated. Please use setWarningLevel(DiagnosticGroups.GLOBAL_THIS, level) instead. -
setNumParallelThreads
public void setNumParallelThreads(int parallelism) Sets the level of parallelism for compilation passes that can exploit multi-threading.Some compiler passes may take advantage of multi-threading, for example, parsing inputs. This sets the level of parallelism. The compiler will not start more than this number of threads.
- Parameters:
parallelism
- up to this number of parallel threads may be created.
-
setRenamePrefixNamespaceAssumeCrossChunkNames
public void setRenamePrefixNamespaceAssumeCrossChunkNames(boolean assume) Useful for tests to avoid having to declare two chunks -
shouldCollapseProperties
Deprecated.use getPropertyCollapseLevelFlattens multi-level property names (e.g. a$b = x) -
getPropertyCollapseLevel
-
setCollapseObjectLiterals
public void setCollapseObjectLiterals(boolean enabled) -
getCollapseObjectLiterals
public boolean getCollapseObjectLiterals() -
setNameGenerator
-
setReplaceMessagesWithChromeI18n
public void setReplaceMessagesWithChromeI18n(boolean replaceMessagesWithChromeI18n, String tcProjectId) -
shouldRunReplaceMessagesForChrome
public boolean shouldRunReplaceMessagesForChrome()Should we run the pass that does replacement of the chrome-specific `chrome.i18n.getMessage()` translatable message definitions?This form of l10n is incompatible with our standard `goog.getMsg()` messages.
-
setAssumeForwardDeclaredForMissingTypes
public void setAssumeForwardDeclaredForMissingTypes(boolean assumeForwardDeclaredForMissingTypes) Iftrue
, considers all missing types to be forward declared (useful for partial compilation). -
setPreferSingleQuotes
public void setPreferSingleQuotes(boolean enabled) Normally, when there are an equal number of single and double quotes in a string, the compiler will use double quotes. Set this to true to prefer single quotes. -
setTrustedStrings
public void setTrustedStrings(boolean yes) Some people want to put arbitrary user input into strings, which are then run through the compiler. These scripts are then put into HTML. By default, we assume strings are untrusted. If the compiler is run from the command-line, we assume that strings are trusted. -
setPrintSourceAfterEachPass
public void setPrintSourceAfterEachPass(boolean printSource) -
setFilesToPrintAfterEachPassRegexList
-
setChunksToPrintAfterEachPassRegexList
-
setQnameUsesToPrintAfterEachPassList
-
getTracerMode
-
setTracerMode
-
setTracerOutput
-
setProtectHiddenSideEffects
public void setProtectHiddenSideEffects(boolean enable) When enabled, assume that apparently side-effect free code is meaningful. -
shouldProtectHiddenSideEffects
public boolean shouldProtectHiddenSideEffects()Whether or not the compiler should wrap apparently side-effect free code to prevent it from being removed -
setAssumeGettersArePure
public void setAssumeGettersArePure(boolean x) -
getAssumeGettersArePure
public boolean getAssumeGettersArePure() -
setAssumeStaticInheritanceIsNotUsed
public void setAssumeStaticInheritanceIsNotUsed(boolean x) -
getAssumeStaticInheritanceIsNotUsed
public boolean getAssumeStaticInheritanceIsNotUsed() -
setConformanceRemoveRegexFromPath
-
getConformanceRemoveRegexFromPath
-
setWrapGoogModulesForWhitespaceOnly
public void setWrapGoogModulesForWhitespaceOnly(boolean enable) -
setBadRewriteModulesBeforeTypecheckingThatWeWantToGetRidOf
public void setBadRewriteModulesBeforeTypecheckingThatWeWantToGetRidOf(boolean b) Whether to enable the bad module rewriting before typechecking that we want to get rid of -
setEnableModuleRewriting
public void setEnableModuleRewriting(boolean enable) Experimental option to disable all Closure and ES module and goog.provide rewritingUse at your own risk - disabling module rewriting is not fully tested yet.
-
setPrintConfig
public void setPrintConfig(boolean printConfig) Should the compiler print its configuration options to stderr when they are initialized?Default
false
. -
setAllowDynamicImport
public void setAllowDynamicImport(boolean value) Whether to enable support for dynamic import expressions -
getDynamicImportAlias
Set the alias name for dynamic import expressions -
setDynamicImportAlias
Set the alias name for dynamic import expressions -
isRemoveUnusedClassProperties
public boolean isRemoveUnusedClassProperties()- Returns:
- Whether to attempt to remove unused class properties
-
setRemoveUnusedClassProperties
public void setRemoveUnusedClassProperties(boolean removeUnusedClassProperties) - Parameters:
removeUnusedClassProperties
- Whether to attempt to remove unused class properties
-
getDefineReplacements
Returns the map of define replacements. -
setDefineToBooleanLiteral
Sets the value of the@define
variable in JS to a boolean literal. -
setDefineToStringLiteral
Sets the value of the@define
variable in JS to a String literal. -
setDefineToNumberLiteral
Sets the value of the@define
variable in JS to a number literal. -
setDefineToDoubleLiteral
Sets the value of the@define
variable in JS to a number literal. -
skipAllCompilerPasses
public void skipAllCompilerPasses()Skip all possible passes, to make the compiler as fast as possible. -
setWarningLevel
Configure the given type of warning to the given level. -
resetWarningsGuard
public void resetWarningsGuard()Reset the warnings guard. -
addWarningsGuard
Add a guard to the set of warnings guards. -
setRenamingPolicy
public void setRenamingPolicy(VariableRenamingPolicy newVariablePolicy, PropertyRenamingPolicy newPropertyPolicy) Sets the variable and property renaming policies for the compiler, in a way that clears warnings about the renaming policy being uninitialized from flags. -
setReplaceIdGenerators
public void setReplaceIdGenerators(boolean replaceIdGenerators) - Parameters:
replaceIdGenerators
- the replaceIdGenerators to set
-
setIdGenerators
Sets the id generators to replace. -
setIdGenerators
Sets the id generators to replace. -
setIdGeneratorsMap
A previous map of ids (serialized to a string by a previous compile). This will be used as a hint during the ReplaceIdGenerators pass, which will attempt to reuse the same ids. -
setXidHashFunction
Sets the hash function to use for Xid -
setChunkIdHashFunction
Sets the hash function to use for chunk ID generation -
setInlineFunctions
Set the function inlining policy for the compiler. -
getInlineFunctionsLevel
Get the function inlining policy for the compiler. -
setMaxFunctionSizeAfterInlining
public void setMaxFunctionSizeAfterInlining(int funAstSize) -
setInlineVariables
public void setInlineVariables(boolean inlineVariables) -
setInlineVariables
Set the variable inlining policy for the compiler. -
setInlineProperties
public void setInlineProperties(boolean enable) Set the function inlining policy for the compiler. -
shouldInlineProperties
public boolean shouldInlineProperties() -
setRemoveUnusedVariables
Set the variable removal policy for the compiler. -
setReplaceStringsConfiguration
public void setReplaceStringsConfiguration(String placeholderToken, List<String> functionDescriptors) Sets the functions whose debug strings to replace. -
setRemoveAbstractMethods
public void setRemoveAbstractMethods(boolean remove) -
setRemoveClosureAsserts
public void setRemoveClosureAsserts(boolean remove) -
setRemoveJ2clAsserts
public void setRemoveJ2clAsserts(boolean remove) -
setColorizeErrorOutput
public void setColorizeErrorOutput(boolean colorizeErrorOutput) -
shouldColorizeErrorOutput
public boolean shouldColorizeErrorOutput() -
setChecksOnly
public void setChecksOnly(boolean checksOnly) -
setOutputJs
-
setGenerateExports
public void setGenerateExports(boolean generateExports) -
setExportLocalPropertyDefinitions
public void setExportLocalPropertyDefinitions(boolean export) -
shouldExportLocalPropertyDefinitions
public boolean shouldExportLocalPropertyDefinitions() -
setAngularPass
public void setAngularPass(boolean angularPass) -
setPolymerVersion
-
setChromePass
public void setChromePass(boolean chromePass) -
isChromePassEnabled
public boolean isChromePassEnabled() -
setJ2clPass
-
setJ2clMinifierEnabled
public void setJ2clMinifierEnabled(boolean enabled) -
setJ2clMinifierPruningManifest
-
setCodingConvention
-
getCodingConvention
-
setDependencyOptions
Sets the dependency management options. -
getDependencyOptions
-
setSummaryDetailLevel
public void setSummaryDetailLevel(int summaryDetailLevel) Controls how detailed the compilation summary is. Values: 0 (never print summary), 1 (print summary only if there are errors or warnings), 2 (print summary if type checking is on), 3 (always print summary). The default level is 1 -
setExtraAnnotationNames
-
setOutputCharset
Sets the output charset. -
setTweakProcessing
Sets how goog.tweak calls are processed. -
getTweakProcessing
-
setLanguage
Sets ECMAScript version to use. -
setLanguageIn
Sets ECMAScript version to use for the input. If you are not transpiling from one version to another, use #setLanguage instead. -
getLanguageIn
-
setLanguageOut
Sets ECMAScript version to use for the output.If you are not transpiling from one version to another, use #setLanguage instead.
If you you need something more fine grained (e.g. "ES2017 without modules") use #setOutputFeatureSet.
-
legacySetOutputFeatureSet
-
getOutputFeatureSet
Gets the set of features that can appear in the output. -
setExperimentalForceTranspiles
public void setExperimentalForceTranspiles(CompilerOptions.ExperimentalForceTranspile... experimentalForceTranspile) -
getExperimentalForceTranspiles
public com.google.common.collect.ImmutableList<CompilerOptions.ExperimentalForceTranspile> getExperimentalForceTranspiles() -
needsTranspilationFrom
-
needsTranspilationOf
-
setEnvironment
Set which set of builtin externs to use. -
getEnvironment
-
setAliasTransformationHandler
-
getAliasTransformationHandler
-
setErrorHandler
Set a custom handler for warnings and errors.This is mostly used for piping the warnings and errors to a file behind the scenes.
If you want to filter warnings and errors, you should use a WarningsGuard.
If you want to change how warnings and errors are reported to the user, you should set a ErrorManager on the Compiler. An ErrorManager is intended to summarize the errors for a single compile job.
-
setInferTypes
public void setInferTypes(boolean enable) If true, enables type inference. If checkTypes is enabled, this flag has no effect. -
getInferTypes
public boolean getInferTypes()Gets the inferTypes flag. Note that if checkTypes is enabled, this flag is ignored when configuring the compiler. -
setNewTypeInference
Deprecated.This is a no-op. -
isTypecheckingEnabled
public boolean isTypecheckingEnabled()- Returns:
- true if either typechecker is ON.
-
assumeStrictThis
public boolean assumeStrictThis()- Returns:
- Whether assumeStrictThis is set.
-
setAssumeStrictThis
public void setAssumeStrictThis(boolean enable) If true, enables enables additional optimizations. -
assumeClosuresOnlyCaptureReferences
public boolean assumeClosuresOnlyCaptureReferences()- Returns:
- Whether assumeClosuresOnlyCaptureReferences is set.
-
setAssumeClosuresOnlyCaptureReferences
public void setAssumeClosuresOnlyCaptureReferences(boolean enable) Whether to assume closures capture only what they reference. This allows more aggressive function inlining. -
setPropertiesThatMustDisambiguate
Sets the list of properties that we report property invalidation errors for. -
getPropertiesThatMustDisambiguate
-
setPreserveDetailedSourceInfo
public void setPreserveDetailedSourceInfo(boolean preserveDetailedSourceInfo) -
setPreserveNonJSDocComments
public void setPreserveNonJSDocComments(boolean preserveNonJSDocComments) -
setContinueAfterErrors
public void setContinueAfterErrors(boolean continueAfterErrors) -
setParseJsDocDocumentation
Enables or disables the parsing of JSDoc documentation, and optionally also the preservation of all whitespace and formatting within a JSDoc comment. By default, whitespace is collapsed for all comments except @license and @preserve blocks, -
isParseJsDocDocumentation
Checks JSDoc documentation will be parsed.- Returns:
- True when JSDoc documentation will be parsed, false if not.
-
setSkipNonTranspilationPasses
public void setSkipNonTranspilationPasses(boolean skipNonTranspilationPasses) Skip all passes (other than transpilation, if requested). Don't inject any runtime libraries (unless explicitly requested) or do any checks/optimizations (this is useful for per-file transpilation). -
setDevMode
-
setCheckDeterminism
public void setCheckDeterminism(boolean checkDeterminism) -
getCheckDeterminism
public boolean getCheckDeterminism() -
setMessageBundle
-
setCheckSymbols
public void setCheckSymbols(boolean checkSymbols) -
setCheckSuspiciousCode
public void setCheckSuspiciousCode(boolean checkSuspiciousCode) -
setCheckTypes
public void setCheckTypes(boolean checkTypes) -
setFoldConstants
public void setFoldConstants(boolean foldConstants) -
setDeadAssignmentElimination
public void setDeadAssignmentElimination(boolean deadAssignmentElimination) -
setInlineConstantVars
public void setInlineConstantVars(boolean inlineConstantVars) -
setCrossChunkCodeMotion
public void setCrossChunkCodeMotion(boolean crossChunkCodeMotion) -
setCrossChunkCodeMotionNoStubMethods
public void setCrossChunkCodeMotionNoStubMethods(boolean crossChunkCodeMotionNoStubMethods) -
setParentChunkCanSeeSymbolsDeclaredInChildren
public void setParentChunkCanSeeSymbolsDeclaredInChildren(boolean parentChunkCanSeeSymbolsDeclaredInChildren) -
setCrossChunkMethodMotion
public void setCrossChunkMethodMotion(boolean crossChunkMethodMotion) -
setCoalesceVariableNames
public void setCoalesceVariableNames(boolean coalesceVariableNames) -
setInlineLocalVariables
public void setInlineLocalVariables(boolean inlineLocalVariables) -
setFlowSensitiveInlineVariables
public void setFlowSensitiveInlineVariables(boolean enabled) -
setSmartNameRemoval
public void setSmartNameRemoval(boolean smartNameRemoval) -
setExtractPrototypeMemberDeclarations
public void setExtractPrototypeMemberDeclarations(boolean enabled) -
setExtractPrototypeMemberDeclarations
public void setExtractPrototypeMemberDeclarations(CompilerOptions.ExtractPrototypeMemberDeclarationsMode mode) -
setRemoveUnusedPrototypeProperties
public void setRemoveUnusedPrototypeProperties(boolean enabled) -
setCollapseVariableDeclarations
public void setCollapseVariableDeclarations(boolean enabled) -
setCollapseAnonymousFunctions
public void setCollapseAnonymousFunctions(boolean enabled) -
setAliasStringsMode
-
getAliasStringsMode
-
setOutputJsStringUsage
public void setOutputJsStringUsage(boolean outputJsStringUsage) -
setConvertToDottedProperties
public void setConvertToDottedProperties(boolean convertToDottedProperties) -
setUseTypesForLocalOptimization
public void setUseTypesForLocalOptimization(boolean useTypesForLocalOptimization) -
shouldUseTypesForLocalOptimization
public boolean shouldUseTypesForLocalOptimization() -
setUseTypesForOptimization
Deprecated. -
setRewriteFunctionExpressions
public void setRewriteFunctionExpressions(boolean rewriteFunctionExpressions) -
setOptimizeCalls
public void setOptimizeCalls(boolean optimizeCalls) -
getOptimizeESClassConstructors
public boolean getOptimizeESClassConstructors() -
setOptimizeESClassConstructors
public void setOptimizeESClassConstructors(boolean optimizeESClassConstructors) -
setVariableRenaming
-
setPropertyRenaming
-
getPropertyRenaming
-
setLabelRenaming
public void setLabelRenaming(boolean labelRenaming) -
setReserveRawExports
public void setReserveRawExports(boolean reserveRawExports) -
setPreferStableNames
public void setPreferStableNames(boolean preferStableNames) -
setGeneratePseudoNames
public void setGeneratePseudoNames(boolean generatePseudoNames) -
setPropertyRenamingOnlyCompilationMode
public void setPropertyRenamingOnlyCompilationMode(boolean propertyRenamingOnlyCompilationMode) -
isPropertyRenamingOnlyCompilationMode
public boolean isPropertyRenamingOnlyCompilationMode() -
setRenamePrefix
-
getRenamePrefixNamespace
-
setRenamePrefixNamespace
-
setCollapsePropertiesLevel
-
setCollapseProperties
Deprecated. -
setDevirtualizeMethods
public void setDevirtualizeMethods(boolean devirtualizeMethods) -
setComputeFunctionSideEffects
public void setComputeFunctionSideEffects(boolean computeFunctionSideEffects) -
setDisambiguateProperties
public void setDisambiguateProperties(boolean disambiguateProperties) -
shouldDisambiguateProperties
public boolean shouldDisambiguateProperties() -
setAmbiguateProperties
public void setAmbiguateProperties(boolean ambiguateProperties) -
shouldAmbiguateProperties
public boolean shouldAmbiguateProperties() -
setInputVariableMap
-
setInputPropertyMap
-
setExportTestFunctions
public void setExportTestFunctions(boolean exportTestFunctions) -
setSyntheticBlockStartMarker
-
setSyntheticBlockEndMarker
-
setLocale
-
setDoLateLocalization
public void setDoLateLocalization(boolean doLateLocalization) -
doLateLocalization
public boolean doLateLocalization() -
shouldRunReplaceMessagesPass
public boolean shouldRunReplaceMessagesPass()Should we run any form of the `ReplaceMessages` pass? -
setMarkAsCompiled
public void setMarkAsCompiled(boolean markAsCompiled) -
setClosurePass
public void setClosurePass(boolean closurePass) -
setPreserveClosurePrimitives
public void setPreserveClosurePrimitives(boolean preserveClosurePrimitives) Preserve closure primitives.For now, this only preserves goog.provide(), goog.require() and goog.module() calls.
-
shouldPreservesGoogProvidesAndRequires
public boolean shouldPreservesGoogProvidesAndRequires() -
shouldPreserveGoogModule
public boolean shouldPreserveGoogModule() -
shouldPreserveGoogLibraryPrimitives
public boolean shouldPreserveGoogLibraryPrimitives()Do not process goog. intrinsics, such as goog.getCssName(). -
setPreserveTypeAnnotations
public void setPreserveTypeAnnotations(boolean preserveTypeAnnotations) -
setGentsMode
public void setGentsMode(boolean gentsMode) -
setGatherCssNames
public void setGatherCssNames(boolean gatherCssNames) -
setStripTypes
Deprecated.StripCode is deprecated. Code should be designed to be removed by other means. -
getStripTypes
Deprecated.StripCode is deprecated. Code should be designed to be removed by other means. -
setStripNameSuffixes
Deprecated.StripCode is deprecated. Code should be designed to be removed by other means. -
setStripNamePrefixes
Deprecated.StripCode is deprecated. Code should be designed to be removed by other means. -
addCustomPass
-
setDefineReplacements
-
getEnableZonesDefineName
-
setEnableZonesDefineName
-
getZoneInputPattern
-
setZoneInputPattern
-
setRewriteGlobalDeclarationsForTryCatchWrapping
public void setRewriteGlobalDeclarationsForTryCatchWrapping(boolean rewrite) -
setCssRenamingMap
-
setCssRenamingSkiplist
-
setReplaceStringsFunctionDescriptions
-
setReplaceStringsPlaceholderToken
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint) -
isPrettyPrint
public boolean isPrettyPrint() -
setLineBreak
public void setLineBreak(boolean lineBreak) -
setPrintInputDelimiter
public void setPrintInputDelimiter(boolean printInputDelimiter) -
setInputDelimiter
-
setDebugLogDirectory
-
getDebugLogDirectory
-
setDebugLogFilter
-
getDebugLogFilter
-
setQuoteKeywordProperties
public void setQuoteKeywordProperties(boolean quoteKeywordProperties) -
shouldQuoteKeywordProperties
public boolean shouldQuoteKeywordProperties() -
setErrorFormat
-
getErrorFormat
-
setWarningsGuard
-
setLineLengthThreshold
public void setLineLengthThreshold(int lineLengthThreshold) -
getLineLengthThreshold
public int getLineLengthThreshold() -
setUseOriginalNamesInOutput
public void setUseOriginalNamesInOutput(boolean useOriginalNamesInOutput) -
getUseOriginalNamesInOutput
public boolean getUseOriginalNamesInOutput() -
setExternExportsPath
-
getExternExportsPath
-
setSourceMapOutputPath
-
setApplyInputSourceMaps
public void setApplyInputSourceMaps(boolean applyInputSourceMaps) -
setResolveSourceMapAnnotations
public void setResolveSourceMapAnnotations(boolean resolveSourceMapAnnotations) -
setSourceMapIncludeSourcesContent
public void setSourceMapIncludeSourcesContent(boolean sourceMapIncludeSourcesContent) -
setParseInlineSourceMaps
public void setParseInlineSourceMaps(boolean parseInlineSourceMaps) -
setSourceMapDetailLevel
-
setSourceMapFormat
-
setSourceMapLocationMappings
public void setSourceMapLocationMappings(List<? extends SourceMap.LocationMapping> sourceMapLocationMappings) -
setProcessCommonJSModules
public void setProcessCommonJSModules(boolean processCommonJSModules) Rewrites CommonJS modules so that modules can be concatenated together, by renaming all globals to avoid conflicting with other modules. -
getProcessCommonJSModules
public boolean getProcessCommonJSModules() -
setEs6ModuleTranspilation
-
getEs6ModuleTranspilation
-
setCommonJSModulePathPrefix
Sets a path prefix for CommonJS modules (maps tosetModuleRoots(List)
). -
setModuleRoots
Sets the module roots. -
setRewritePolyfills
public void setRewritePolyfills(boolean rewritePolyfills) Sets whether to rewrite polyfills. -
getRewritePolyfills
public boolean getRewritePolyfills() -
setIsolatePolyfills
public void setIsolatePolyfills(boolean isolatePolyfills) Sets whether to isolate polyfills from the global scope. -
getIsolatePolyfills
public boolean getIsolatePolyfills() -
setInjectPolyfillsNewerThan
-
setInstrumentAsyncContext
public void setInstrumentAsyncContext(boolean instrumentAsyncContext) Sets whether to transpile async functions and generators for AsyncContext. -
getInstrumentAsyncContext
public boolean getInstrumentAsyncContext() -
setDiagnoseAsyncContextSafariCrash
public void setDiagnoseAsyncContextSafariCrash(boolean diagnose) Sets whether to diagnose the Safari crash in async context instrumentation. -
setForceLibraryInjection
Sets list of libraries to always inject, even if not needed. -
setPreventLibraryInjection
public void setPreventLibraryInjection(boolean preventLibraryInjection) Sets the set of libraries to never inject, even if required. -
setUnusedImportsToRemove
public void setUnusedImportsToRemove(@Nullable com.google.common.collect.ImmutableSet<String> unusedImportsToRemove) -
getUnusedImportsToRemove
-
setInstrumentForCoverageOption
public void setInstrumentForCoverageOption(CompilerOptions.InstrumentOption instrumentForCoverageOption) -
getInstrumentForCoverageOption
-
setProductionInstrumentationArrayName
Sets the name for the global array which is used by PRODUCTION instrumentation. The array is declared during the instrumentation pass with the name provided through this setter. -
getProductionInstrumentationArrayName
-
getConformanceConfigs
public final com.google.common.collect.ImmutableList<com.google.javascript.jscomp.ConformanceConfig> getConformanceConfigs() -
setConformanceConfig
@Deprecated public void setConformanceConfig(com.google.javascript.jscomp.ConformanceConfig conformanceConfig) Deprecated.See go/binary-level-conformance-deprecated.Both enable and configure conformance checks, if non-null. -
setConformanceConfigs
@Deprecated public void setConformanceConfigs(List<com.google.javascript.jscomp.ConformanceConfig> configs) Deprecated.See go/binary-level-conformance-deprecated.Both enable and configure conformance checks, if non-null. -
clearConformanceConfigs
public void clearConformanceConfigs() -
shouldEmitUseStrict
public boolean shouldEmitUseStrict()Whether the output should contain a 'use strict' directive. -
setEmitUseStrict
-
getModuleResolutionMode
-
setModuleResolutionMode
-
getBrowserResolverPrefixReplacements
-
setBrowserResolverPrefixReplacements
-
setPathEscaper
-
getPathEscaper
-
getPackageJsonEntryNames
-
setPackageJsonEntryNames
-
setUseSizeHeuristicToStopOptimizationLoop
public void setUseSizeHeuristicToStopOptimizationLoop(boolean mayStopEarly) -
setMaxOptimizationLoopIterations
public void setMaxOptimizationLoopIterations(int maxIterations) -
getChunkOutputType
-
setChunkOutputType
-
setStrictMessageReplacement
public void setStrictMessageReplacement(boolean strictMessageReplacement) -
getStrictMessageReplacement
public boolean getStrictMessageReplacement() -
toString
-
expectStrictModeInput
public boolean expectStrictModeInput() -
setStrictModeInput
-
getPropertyReservedNamingFirstChars
public char[] getPropertyReservedNamingFirstChars() -
getPropertyReservedNamingNonFirstChars
public char[] getPropertyReservedNamingNonFirstChars()
-