Package com.google.javascript.jscomp
Class CompilerOptions
- java.lang.Object
-
- com.google.javascript.jscomp.CompilerOptions
-
- All Implemented Interfaces:
java.io.Serializable
public class CompilerOptions extends java.lang.Object implements java.io.Serializable
Compiler options- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CompilerOptions.AliasTransformation
A Role Specific Interface for the JS Compiler to report aliases used to change the code during a compile.static interface
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.static class
CompilerOptions.DevMode
When to do the extra validity checksstatic class
CompilerOptions.Environment
An environment specifies the built-in externs that are loaded for a given compilation.static class
CompilerOptions.Es6ModuleTranspilation
How ES6 modules should be transformed.static class
CompilerOptions.ExtractPrototypeMemberDeclarationsMode
static class
CompilerOptions.IncrementalCheckMode
static class
CompilerOptions.InstrumentOption
An option to determine what level of code instrumentation is performed, if anystatic class
CompilerOptions.IsolationMode
What kind of isolation is going to be usedstatic class
CompilerOptions.J2clPassMode
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 class
CompilerOptions.LanguageMode
A language mode applies to the whole compilation job.static class
CompilerOptions.OutputJs
What type of JS file should be output by this compilationstatic class
CompilerOptions.PropertyCollapseLevel
static class
CompilerOptions.Reach
A common enum for compiler passes that can run either globally or locally.static class
CompilerOptions.TracerMode
How much tracing we want to dostatic class
CompilerOptions.TweakProcessing
Option for the ProcessTweaks pass
-
Field Summary
Fields Modifier and Type Field Description java.util.Set<java.lang.String>
aliasableStrings
If set to a non-empty set, those strings literals will be aliased to a single global instance per string, to avoid creating more objects than necessary.boolean
aliasAllStrings
Aliases all string literals to global instances, to avoid creating more objects than necessary (if true, overrides any set of strings passed in to aliasableStrings)java.lang.String
aliasStringsBlacklist
A blacklist in the form of a regular expression to block strings that contains certain words from being aliased.AnonymousFunctionNamingPolicy
anonymousFunctionNaming
Give anonymous functions names for easier debuggingCheckLevel
brokenClosureRequiresLevel
Deprecated.CheckLevel
checkGlobalNamesLevel
java.lang.String
checkMissingGetCssNameBlacklist
Regex of string literals that may only appear in goog.getCssName arguments.CheckLevel
checkMissingGetCssNameLevel
boolean
checkSuspiciousCode
Checks for suspicious statements that have no effectboolean
checkSymbols
Checks that all symbols are definedboolean
checkTypes
Checks types on expressionsboolean
closurePass
Processes goog.provide() and goog.require() callsboolean
coalesceVariableNames
Merge two variables together as one.boolean
collapseAnonymousFunctions
Collapses anonymous function declarations into named function declarationsboolean
collapseVariableDeclarations
Collapses multiple variable declarations into oneboolean
computeFunctionSideEffects
Use @nosideeffects annotations, function bodies and name graph to determine if calls have side effects.boolean
convertToDottedProperties
Converts quoted property accesses to dot syntax (a['b'] → a.b)CssRenamingMap
cssRenamingMap
Map used in the renaming of CSS class names.protected com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass>
customPasses
Custom passesboolean
deadAssignmentElimination
Remove assignments to values that can not be referencedboolean
devirtualizeMethods
Devirtualize prototype method by rewriting them to be static calls that take the this pointer as their first argumentErrorFormat
errorFormat
boolean
exportTestFunctions
Whether to export test functions.boolean
flowSensitiveInlineVariables
boolean
foldConstants
Folds constants (e.g.boolean
gatherCssNames
Gather CSS names (requires closurePass)boolean
generateExports
boolean
generatePseudoNames
Generate pseudo names for variables and properties for debugging purposes.boolean
inlineConstantVars
Inlines constants (symbols that are all CAPS)boolean
inlineVariables
Inlines variablesjava.lang.String
inputDelimiter
The string to use as the separator for printInputDelimiterboolean
instrumentBranchCoverage
Deprecated.Please use setInstrumentForCoverageOption with BRANCH_ONLY InstrumentationOption insteadboolean
instrumentForCoverage
Deprecated.Please use setInstrumentForCoverageOption with LINE_ONLY InstrumentationOption insteadboolean
labelRenaming
Controls label renaming.boolean
lineBreak
Line break the output a bit more aggressivelyjava.lang.String
locale
Compiling localeboolean
markAsCompiled
Sets the special "COMPILED" value to trueMessageBundle
messageBundle
Returns localized replacement for MSG_* variablesboolean
moveFunctionDeclarations
Move top-level function declarations to the topboolean
optimizeArgumentsArray
Provide formal names for elements of arguments array.boolean
optimizeCalls
Remove unused parameters from call sites.boolean
preferLineBreakAtEndOfFile
Prefer line breaks at end of fileboolean
preserveTypeAnnotations
Do not strip closure-style type annotations from code.boolean
printInputDelimiter
Prints a separator comment before each JS scriptboolean
removeDeadCode
Removes code that will never executeboolean
removeUnusedClassProperties
Removes unused member propertiesboolean
removeUnusedLocalVars
Removes unused variables in local scope.boolean
removeUnusedPrototypeProperties
Removes unused member prototypesboolean
removeUnusedPrototypePropertiesInExterns
Tells AnalyzePrototypeProperties it can remove externed props.boolean
removeUnusedVars
Removes unused variablesjava.lang.String
renamePrefix
Specifies a prefix for all globalsjava.lang.String
renamePrefixNamespace
Specifies the name of an object that will be used to store all non-extern globals.boolean
reserveRawExports
Reserve property names on the global this object.boolean
rewriteFunctionExpressions
Reduces the size of common function expressions.boolean
smartNameRemoval
Removes code associated with unused global namesSourceMap.DetailLevel
sourceMapDetailLevel
The detail level for the generated source map.SourceMap.Format
sourceMapFormat
The source map file formatjava.util.List<? extends SourceMap.LocationMapping>
sourceMapLocationMappings
java.lang.String
sourceMapOutputPath
The output path for the source map.java.util.Set<java.lang.String>
stripNamePrefixes
Name prefixes that determine which variables and properties to stripjava.util.Set<java.lang.String>
stripNameSuffixes
Name suffixes that determine which variables and properties to stripjava.util.Set<java.lang.String>
stripTypePrefixes
Qualified type name prefixes that determine which types to stripjava.util.Set<java.lang.String>
stripTypes
Names of types to stripjava.lang.String
syntheticBlockEndMarker
java.lang.String
syntheticBlockStartMarker
VariableRenamingPolicy
variableRenaming
Controls which variables get renamed.
-
Constructor Summary
Constructors Constructor Description CompilerOptions()
Initializes compiler options.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addCustomPass(CustomPassExecutionTime time, CompilerPass customPass)
void
addWarningsGuard(WarningsGuard guard)
Add a guard to the set of warnings guards.boolean
assumeClosuresOnlyCaptureReferences()
boolean
assumeStrictThis()
void
clearConformanceConfigs()
static CompilerOptions
deserialize(java.io.InputStream objectInputStream)
Deserializes compiler options from a stream.void
disableRuntimeTypeCheck()
void
enableRuntimeTypeCheck(java.lang.String logFunction)
Enable run-time type checking, which adds JS type assertions for debugging.boolean
expectStrictModeInput()
CompilerOptions.AliasTransformationHandler
getAliasTransformationHandler()
static com.google.common.collect.ImmutableSet<java.lang.Character>
getAngularPropertyReservedFirstChars()
boolean
getAssumeGettersArePure()
boolean
getAssumeStaticInheritanceRequired()
java.lang.Integer
getBrowserFeaturesetYear()
com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String>
getBrowserResolverPrefixReplacements()
boolean
getCheckDeterminism()
CodingConvention
getCodingConvention()
boolean
getCollapseObjectLiterals()
com.google.common.collect.ImmutableList<ConformanceConfig>
getConformanceConfigs()
com.google.common.base.Optional<java.util.regex.Pattern>
getConformanceRemoveRegexFromPath()
java.nio.file.Path
getDebugLogDirectory()
java.util.Map<java.lang.String,Node>
getDefineReplacements()
Returns the map of define replacements.DependencyOptions
getDependencyOptions()
CompilerOptions.Environment
getEnvironment()
ErrorFormat
getErrorFormat()
CompilerOptions.Es6ModuleTranspilation
getEs6ModuleTranspilation()
boolean
getInferTypes()
Gets the inferTypes flag.CompilerOptions.Reach
getInlineFunctionsLevel()
Get the function inlining policy for the compiler.boolean
getInstrumentForCoverageOnly()
CompilerOptions.InstrumentOption
getInstrumentForCoverageOption()
boolean
getIsolatePolyfills()
CompilerOptions.LanguageMode
getLanguageIn()
int
getLineLengthThreshold()
ModuleLoader.ResolutionMode
getModuleResolutionMode()
FeatureSet
getOutputFeatureSet()
Gets the set of features that can appear in the output.java.util.List<java.lang.String>
getPackageJsonEntryNames()
ModuleLoader.PathEscaper
getPathEscaper()
boolean
getPreferLineBreakAtEndOfFile()
boolean
getProcessCommonJSModules()
CompilerOptions.PropertyCollapseLevel
getPropertyCollapseLevel()
PropertyRenamingPolicy
getPropertyRenaming()
char[]
getPropertyReservedNamingFirstChars()
char[]
getPropertyReservedNamingNonFirstChars()
java.lang.String
getRenamePrefixNamespace()
boolean
getRewritePolyfills()
CompilerOptions.TracerMode
getTracerMode()
CompilerOptions.TweakProcessing
getTweakProcessing()
java.util.Map<java.lang.String,Node>
getTweakReplacements()
Returns the map of tweak replacements.boolean
getUseOriginalNamesInOutput()
boolean
isChromePassEnabled()
boolean
isExternExportsEnabled()
Config.JsDocParsing
isParseJsDocDocumentation()
Checks JSDoc documentation will be parsed.boolean
isPrettyPrint()
boolean
isRemoveUnusedClassProperties()
boolean
isTypecheckingEnabled()
boolean
needsTranspilationFrom(FeatureSet languageLevel)
boolean
needsTranspilationOf(FeatureSet.Feature feature)
void
resetWarningsGuard()
Reset the warnings guard.void
serialize(java.io.OutputStream objectOutputStream)
Serializes compiler options to a stream.void
setAliasableStrings(java.util.Set<java.lang.String> aliasableStrings)
void
setAliasAllStrings(boolean aliasAllStrings)
void
setAliasStringsBlacklist(java.lang.String aliasStringsBlacklist)
void
setAliasTransformationHandler(CompilerOptions.AliasTransformationHandler changes)
void
setAllowHotswapReplaceScript(boolean allowRecompilation)
void
setAmbiguateProperties(boolean ambiguateProperties)
void
setAngularPass(boolean angularPass)
void
setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming)
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
setAssumeStaticInheritanceRequired(boolean x)
void
setAssumeStrictThis(boolean enable)
If true, enables enables additional optimizations.void
setBadRewriteModulesBeforeTypecheckingThatWeWantToGetRidOf(boolean b)
Whether to enable the bad module rewriting before typechecking that we want to get rid ofvoid
setBrokenClosureRequiresLevel(CheckLevel level)
Deprecated.void
setBrowserFeaturesetYear(java.lang.Integer year)
void
setBrowserResolverPrefixReplacements(com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> browserResolverPrefixReplacements)
void
setCheckDeterminism(boolean checkDeterminism)
void
setCheckGlobalNamesLevel(CheckLevel level)
Checks the integrity of references to qualified global names.void
setCheckGlobalThisLevel(CheckLevel level)
Deprecated.void
setCheckMissingGetCssNameBlacklist(java.lang.String blackList)
void
setCheckMissingGetCssNameLevel(CheckLevel level)
Checks that certain string literals only appear in strings used as goog.getCssName arguments.void
setChecksOnly(boolean checksOnly)
void
setCheckSuspiciousCode(boolean checkSuspiciousCode)
void
setCheckSymbols(boolean checkSymbols)
void
setCheckTypes(boolean checkTypes)
void
setChromePass(boolean chromePass)
void
setChunksToPrintAfterEachPassRegexList(java.util.List<java.lang.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
setCollapsePropertiesLevel(CompilerOptions.PropertyCollapseLevel level)
void
setCollapseVariableDeclarations(boolean enabled)
void
setColorizeErrorOutput(boolean colorizeErrorOutput)
void
setCommonJSModulePathPrefix(java.lang.String commonJSModulePathPrefix)
Sets a path prefix for CommonJS modules (maps tosetModuleRoots(List)
).void
setComputeFunctionSideEffects(boolean computeFunctionSideEffects)
void
setConformanceConfig(ConformanceConfig conformanceConfig)
Both enable and configure conformance checks, if non-null.void
setConformanceConfigs(java.util.List<ConformanceConfig> configs)
Both enable and configure conformance checks, if non-null.void
setConformanceRemoveRegexFromPath(com.google.common.base.Optional<java.util.regex.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(java.util.Set<java.lang.String> skiplist)
void
setCssRenamingWhitelist(java.util.Set<java.lang.String> skiplist)
Deprecated.void
setDartPass(boolean dartPass)
void
setDeadAssignmentElimination(boolean deadAssignmentElimination)
void
setDebugLogDirectory(java.nio.file.Path dir)
void
setDefineReplacements(java.util.Map<java.lang.String,java.lang.Object> defineReplacements)
void
setDefineToBooleanLiteral(java.lang.String defineName, boolean value)
Sets the value of the@define
variable in JS to a boolean literal.void
setDefineToDoubleLiteral(java.lang.String defineName, double value)
Sets the value of the@define
variable in JS to a number literal.void
setDefineToNumberLiteral(java.lang.String defineName, int value)
Sets the value of the@define
variable in JS to a number literal.void
setDefineToStringLiteral(java.lang.String defineName, java.lang.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
setDisambiguateProperties(boolean disambiguateProperties)
CompilerOptions
setEmitUseStrict(boolean emitUseStrict)
void
setEnableModuleRewriting(boolean enable)
Experimental option to disable all Closure and ES module rewritingvoid
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
setEs6ModuleTranspilation(CompilerOptions.Es6ModuleTranspilation value)
void
setExportLocalPropertyDefinitions(boolean export)
void
setExportTestFunctions(boolean exportTestFunctions)
void
setExternExports(boolean externExports)
void
setExternExportsPath(java.lang.String externExportsPath)
void
setExtraAnnotationNames(java.lang.Iterable<java.lang.String> extraAnnotationNames)
void
setExtractPrototypeMemberDeclarations(boolean enabled)
void
setExtractPrototypeMemberDeclarations(CompilerOptions.ExtractPrototypeMemberDeclarationsMode mode)
void
setExtraSmartNameRemoval(boolean smartNameRemoval)
void
setFilesToPrintAfterEachPassRegexList(java.util.List<java.lang.String> filePathRegexList)
void
setFlowSensitiveInlineVariables(boolean enabled)
void
setFoldConstants(boolean foldConstants)
void
setForceLibraryInjection(java.lang.Iterable<java.lang.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
setIdGenerators(java.util.Map<java.lang.String,RenamingMap> idGenerators)
Sets the id generators to replace.void
setIdGenerators(java.util.Set<java.lang.String> idGenerators)
Sets the id generators to replace.void
setIdGeneratorsMap(java.lang.String previousMappings)
A previous map of ids (serialized to a string by a previous compile).void
setIncrementalChecks(CompilerOptions.IncrementalCheckMode value)
void
setInferConst(boolean value)
void
setInferTypes(boolean enable)
If true, enables type inference.void
setInlineConstantVars(boolean inlineConstantVars)
void
setInlineFunctions(boolean inlineFunctions)
Deprecated.void
setInlineFunctions(CompilerOptions.Reach reach)
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
setInlineVariables(CompilerOptions.Reach reach)
Set the variable inlining policy for the compiler.void
setInputAnonymousFunctionNamingMap(VariableMap inputMap)
void
setInputDelimiter(java.lang.String inputDelimiter)
void
setInputPropertyMap(VariableMap inputPropertyMap)
void
setInputSourceMaps(com.google.common.collect.ImmutableMap<java.lang.String,SourceMapInput> inputSourceMaps)
Sets the input sourcemap files, indexed by the JS files they refer to.void
setInputVariableMap(VariableMap inputVariableMap)
void
setInstrumentBranchCoverage(boolean instrumentBranchCoverage)
Set whether to instrument to collect branch coveragevoid
setInstrumentForCoverage(boolean instrumentForCoverage)
Set whether or not code should be modified to provide coverage information.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(java.lang.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
setLocale(java.lang.String locale)
void
setMarkAsCompiled(boolean markAsCompiled)
void
setMaxFunctionSizeAfterInlining(int funAstSize)
void
setMaxOptimizationLoopIterations(int maxIterations)
void
setMessageBundle(MessageBundle messageBundle)
void
setModuleResolutionMode(ModuleLoader.ResolutionMode moduleResolutionMode)
void
setModuleRoots(java.util.List<java.lang.String> moduleRoots)
Sets the module roots.void
setModulesToPrintAfterEachPassRegexList(java.util.List<java.lang.String> chunkPathRegexList)
Deprecated.void
setMoveFunctionDeclarations(boolean moveFunctionDeclarations)
void
setNameGenerator(com.google.javascript.jscomp.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
setOptimizeArgumentsArray(boolean optimizeArgumentsArray)
void
setOptimizeCalls(boolean optimizeCalls)
void
setOutputCharset(java.nio.charset.Charset charset)
Sets the output charset.void
setOutputFeatureSet(FeatureSet featureSet)
Sets the features that allowed to appear in the output.void
setOutputJs(CompilerOptions.OutputJs outputJs)
void
setOutputJsStringUsage(boolean outputJsStringUsage)
void
setPackageJsonEntryNames(java.util.List<java.lang.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
setPolymerExportPolicy(PolymerExportPolicy polymerExportPolicy)
void
setPolymerVersion(java.lang.Integer polymerVersion)
void
setPreferLineBreakAtEndOfFile(boolean lineBreakAtEnd)
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
setPropertyInvalidationErrors(java.util.Map<java.lang.String,CheckLevel> propertyInvalidationErrors)
Sets the list of properties that we report property invalidation errors for.void
setPropertyRenaming(PropertyRenamingPolicy propertyRenaming)
void
setProtectHiddenSideEffects(boolean enable)
When enabled, assume that apparently side-effect free code is meaningful.void
setQuoteKeywordProperties(boolean quoteKeywordProperties)
void
setRemoveAbstractMethods(boolean remove)
void
setRemoveClosureAsserts(boolean remove)
void
setRemoveDeadCode(boolean removeDeadCode)
void
setRemoveJ2clAsserts(boolean remove)
void
setRemoveUnusedClassProperties(boolean removeUnusedClassProperties)
void
setRemoveUnusedPrototypeProperties(boolean enabled)
void
setRemoveUnusedPrototypePropertiesInExterns(boolean enabled)
void
setRemoveUnusedVariables(CompilerOptions.Reach reach)
Set the variable removal policy for the compiler.void
setRenamePrefix(java.lang.String renamePrefix)
void
setRenamePrefixNamespace(java.lang.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, java.lang.String tcProjectId)
void
setReplaceStringsConfiguration(java.lang.String placeholderToken, java.util.List<java.lang.String> functionDescriptors)
Sets the functions whose debug strings to replace.void
setReplaceStringsFunctionDescriptions(java.util.List<java.lang.String> replaceStringsFunctionDescriptions)
void
setReplaceStringsInputMap(VariableMap serializedMap)
void
setReplaceStringsPlaceholderToken(java.lang.String replaceStringsPlaceholderToken)
void
setReplaceStringsReservedStrings(java.util.Set<java.lang.String> replaceStringsReservedStrings)
void
setReserveRawExports(boolean reserveRawExports)
void
setResolveSourceMapAnnotations(boolean resolveSourceMapAnnotations)
void
setRewriteFunctionExpressions(boolean rewriteFunctionExpressions)
void
setRewritePolyfills(boolean rewritePolyfills)
Sets whether to rewrite polyfills.void
setRuntimeTypeCheck(boolean runtimeTypeCheck)
void
setRuntimeTypeCheckLogFunction(java.lang.String runtimeTypeCheckLogFunction)
void
setShadowVariables(boolean shadow)
Deprecated.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(java.util.List<? extends SourceMap.LocationMapping> sourceMapLocationMappings)
void
setSourceMapOutputPath(java.lang.String sourceMapOutputPath)
CompilerOptions
setStrictModeInput(boolean isStrictModeInput)
void
setStripNamePrefixes(java.util.Set<java.lang.String> stripNamePrefixes)
void
setStripNameSuffixes(java.util.Set<java.lang.String> stripNameSuffixes)
void
setStripTypePrefixes(java.util.Set<java.lang.String> stripTypePrefixes)
void
setStripTypes(java.util.Set<java.lang.String> stripTypes)
void
setSummaryDetailLevel(int summaryDetailLevel)
Controls how detailed the compilation summary is.void
setSyntheticBlockEndMarker(java.lang.String syntheticBlockEndMarker)
void
setSyntheticBlockStartMarker(java.lang.String syntheticBlockStartMarker)
void
setTracerMode(CompilerOptions.TracerMode mode)
void
setTracerOutput(java.nio.file.Path out)
void
setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
Activates transformation of AMD to CommonJS modules.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
setTweakReplacements(java.util.Map<java.lang.String,java.lang.Object> tweakReplacements)
void
setTweakToBooleanLiteral(java.lang.String tweakId, boolean value)
Sets the value of the tweak in JS to a boolean literal.void
setTweakToDoubleLiteral(java.lang.String tweakId, double value)
Sets the value of the tweak in JS to a number literal.void
setTweakToNumberLiteral(java.lang.String tweakId, int value)
Sets the value of the tweak in JS to a number literal.void
setTweakToStringLiteral(java.lang.String tweakId, java.lang.String value)
Sets the value of the tweak in JS to a String literal.void
setUseGraphBasedDisambiguator(boolean x)
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 Xidboolean
shouldAmbiguateProperties()
boolean
shouldCollapseProperties()
Deprecated.use getPropertyCollapseLevelboolean
shouldColorizeErrorOutput()
boolean
shouldDisambiguateProperties()
boolean
shouldEmitUseStrict()
Whether the output should contain a 'use strict' directive.boolean
shouldExportLocalPropertyDefinitions()
boolean
shouldGenerateTypedExterns()
boolean
shouldInlineProperties()
boolean
shouldPreserveGoogLibraryPrimitives()
Do not process goog.boolean
shouldPreserveGoogModule()
boolean
shouldPreservesGoogProvidesAndRequires()
boolean
shouldProtectHiddenSideEffects()
Whether or not the compiler should wrap apparently side-effect free code to prevent it from being removedboolean
shouldQuoteKeywordProperties()
boolean
shouldRunCrossChunkCodeMotion()
boolean
shouldRunCrossChunkMethodMotion()
boolean
shouldRunTypeSummaryChecksLate()
boolean
shouldUseGraphBasedDisambiguator()
boolean
shouldUseTypesForLocalOptimization()
void
skipAllCompilerPasses()
Skip all possible passes, to make the compiler as fast as possible.java.lang.String
toString()
void
validateBrowserFeaturesetYearOption(java.lang.Integer inputYear)
Validates whether browser featureset year option is legal
-
-
-
Field Detail
-
messageBundle
public MessageBundle messageBundle
Returns localized replacement for MSG_* variables
-
checkSymbols
public boolean checkSymbols
Checks that all symbols are defined
-
checkSuspiciousCode
public boolean checkSuspiciousCode
Checks for suspicious statements that have no effect
-
checkTypes
public boolean checkTypes
Checks types on expressions
-
checkGlobalNamesLevel
public CheckLevel checkGlobalNamesLevel
-
brokenClosureRequiresLevel
@Deprecated public CheckLevel brokenClosureRequiresLevel
Deprecated.
-
checkMissingGetCssNameLevel
public CheckLevel checkMissingGetCssNameLevel
-
checkMissingGetCssNameBlacklist
public java.lang.String checkMissingGetCssNameBlacklist
Regex of string literals that may only appear in goog.getCssName arguments.
-
foldConstants
public boolean foldConstants
Folds constants (e.g. (2 + 3) to 5)
-
deadAssignmentElimination
public boolean deadAssignmentElimination
Remove assignments to values that can not be referenced
-
inlineConstantVars
public boolean inlineConstantVars
Inlines constants (symbols that are all CAPS)
-
coalesceVariableNames
public boolean coalesceVariableNames
Merge two variables together as one.
-
inlineVariables
public boolean inlineVariables
Inlines variables
-
flowSensitiveInlineVariables
public boolean flowSensitiveInlineVariables
-
smartNameRemoval
public boolean smartNameRemoval
Removes code associated with unused global names
-
removeDeadCode
public boolean removeDeadCode
Removes code that will never execute
-
removeUnusedPrototypeProperties
public boolean removeUnusedPrototypeProperties
Removes unused member prototypes
-
removeUnusedPrototypePropertiesInExterns
public boolean removeUnusedPrototypePropertiesInExterns
Tells AnalyzePrototypeProperties it can remove externed props.
-
removeUnusedClassProperties
public boolean removeUnusedClassProperties
Removes unused member properties
-
removeUnusedVars
public boolean removeUnusedVars
Removes unused variables
-
removeUnusedLocalVars
public boolean removeUnusedLocalVars
Removes unused variables in local scope.
-
collapseVariableDeclarations
public boolean collapseVariableDeclarations
Collapses multiple variable declarations into one
-
collapseAnonymousFunctions
public boolean collapseAnonymousFunctions
Collapses anonymous function declarations into named function declarations
-
aliasableStrings
public java.util.Set<java.lang.String> aliasableStrings
If set to a non-empty set, those strings literals will be aliased to a single global instance per string, to avoid creating more objects than necessary.
-
aliasStringsBlacklist
public java.lang.String aliasStringsBlacklist
A blacklist in the form of a regular expression to block strings that contains certain words from being aliased. If the value is the empty string, no words are blacklisted.
-
aliasAllStrings
public boolean aliasAllStrings
Aliases all string literals to global instances, to avoid creating more objects than necessary (if true, overrides any set of strings passed in to aliasableStrings)
-
convertToDottedProperties
public boolean convertToDottedProperties
Converts quoted property accesses to dot syntax (a['b'] → a.b)
-
rewriteFunctionExpressions
public boolean rewriteFunctionExpressions
Reduces the size of common function expressions.
-
optimizeCalls
public boolean optimizeCalls
Remove unused parameters from call sites.
-
optimizeArgumentsArray
public boolean optimizeArgumentsArray
Provide formal names for elements of arguments array.
-
variableRenaming
public VariableRenamingPolicy variableRenaming
Controls which variables get renamed.
-
labelRenaming
public boolean labelRenaming
Controls label renaming.
-
reserveRawExports
public boolean reserveRawExports
Reserve property names on the global this object.
-
generatePseudoNames
public boolean generatePseudoNames
Generate pseudo names for variables and properties for debugging purposes.
-
renamePrefix
public java.lang.String renamePrefix
Specifies a prefix for all globals
-
renamePrefixNamespace
public java.lang.String renamePrefixNamespace
Specifies the name of an object that will be used to store all non-extern globals.
-
devirtualizeMethods
public boolean devirtualizeMethods
Devirtualize prototype method by rewriting them to be static calls that take the this pointer as their first argument
-
computeFunctionSideEffects
public boolean computeFunctionSideEffects
Use @nosideeffects annotations, function bodies and name graph to determine if calls have side effects. Requires --check_types.
-
anonymousFunctionNaming
public AnonymousFunctionNamingPolicy anonymousFunctionNaming
Give anonymous functions names for easier debugging
-
exportTestFunctions
public boolean exportTestFunctions
Whether to export test functions.
-
syntheticBlockStartMarker
@Nullable public java.lang.String syntheticBlockStartMarker
-
syntheticBlockEndMarker
@Nullable public java.lang.String syntheticBlockEndMarker
-
locale
public java.lang.String locale
Compiling locale
-
markAsCompiled
public boolean markAsCompiled
Sets the special "COMPILED" value to true
-
closurePass
public boolean closurePass
Processes goog.provide() and goog.require() calls
-
gatherCssNames
public boolean gatherCssNames
Gather CSS names (requires closurePass)
-
stripTypes
public java.util.Set<java.lang.String> stripTypes
Names of types to strip
-
stripNameSuffixes
public java.util.Set<java.lang.String> stripNameSuffixes
Name suffixes that determine which variables and properties to strip
-
stripNamePrefixes
public java.util.Set<java.lang.String> stripNamePrefixes
Name prefixes that determine which variables and properties to strip
-
stripTypePrefixes
public java.util.Set<java.lang.String> stripTypePrefixes
Qualified type name prefixes that determine which types to strip
-
customPasses
protected transient com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses
Custom passes
-
moveFunctionDeclarations
public boolean moveFunctionDeclarations
Move top-level function declarations to the top
-
generateExports
public boolean generateExports
-
cssRenamingMap
public CssRenamingMap cssRenamingMap
Map used in the renaming of CSS class names.
-
preserveTypeAnnotations
public boolean preserveTypeAnnotations
Do not strip closure-style type annotations from code.
-
lineBreak
public boolean lineBreak
Line break the output a bit more aggressively
-
preferLineBreakAtEndOfFile
public boolean preferLineBreakAtEndOfFile
Prefer line breaks at end of file
-
printInputDelimiter
public boolean printInputDelimiter
Prints a separator comment before each JS script
-
inputDelimiter
public java.lang.String inputDelimiter
The string to use as the separator for printInputDelimiter
-
errorFormat
public ErrorFormat errorFormat
-
sourceMapOutputPath
public java.lang.String sourceMapOutputPath
The output path for the source map.
-
sourceMapDetailLevel
public SourceMap.DetailLevel sourceMapDetailLevel
The detail level for the generated source map.
-
sourceMapFormat
public SourceMap.Format sourceMapFormat
The source map file format
-
sourceMapLocationMappings
public java.util.List<? extends SourceMap.LocationMapping> sourceMapLocationMappings
-
instrumentForCoverage
@Deprecated public boolean instrumentForCoverage
Deprecated.Please use setInstrumentForCoverageOption with LINE_ONLY InstrumentationOption insteadInstrument code for the purpose of collecting coverage data.
-
instrumentBranchCoverage
@Deprecated public boolean instrumentBranchCoverage
Deprecated.Please use setInstrumentForCoverageOption with BRANCH_ONLY InstrumentationOption insteadInstrument branch coverage data - valid only if instrumentForCoverage is True
-
-
Method Detail
-
getAngularPropertyReservedFirstChars
public static com.google.common.collect.ImmutableSet<java.lang.Character> getAngularPropertyReservedFirstChars()
-
shouldRunCrossChunkCodeMotion
public boolean shouldRunCrossChunkCodeMotion()
-
shouldRunCrossChunkMethodMotion
public boolean shouldRunCrossChunkMethodMotion()
-
getBrowserFeaturesetYear
public java.lang.Integer getBrowserFeaturesetYear()
-
validateBrowserFeaturesetYearOption
public void validateBrowserFeaturesetYearOption(java.lang.Integer inputYear)
Validates whether browser featureset year option is legal- Parameters:
inputYear
- Integer value passed as input
-
setBrowserFeaturesetYear
public void setBrowserFeaturesetYear(java.lang.Integer year)
-
setInstrumentForCoverageOnly
public void setInstrumentForCoverageOnly(boolean instrumentForCoverageOnly)
-
getInstrumentForCoverageOnly
public boolean getInstrumentForCoverageOnly()
-
setSkipTranspilationAndCrash
@Deprecated public void setSkipTranspilationAndCrash(boolean value)
Deprecated.
-
setInputSourceMaps
public void setInputSourceMaps(com.google.common.collect.ImmutableMap<java.lang.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
public void setIncrementalChecks(CompilerOptions.IncrementalCheckMode value)
-
shouldGenerateTypedExterns
public boolean shouldGenerateTypedExterns()
-
shouldRunTypeSummaryChecksLate
public boolean shouldRunTypeSummaryChecksLate()
-
setCheckGlobalNamesLevel
public void setCheckGlobalNamesLevel(CheckLevel level)
Checks the integrity of references to qualified global names. (e.g. "a.b")
-
setBrokenClosureRequiresLevel
@Deprecated public void setBrokenClosureRequiresLevel(CheckLevel level)
Deprecated.Sets the check level for bad Closure require calls. Do not use; this should always be an error.
-
setCheckGlobalThisLevel
@Deprecated public void setCheckGlobalThisLevel(CheckLevel level)
Deprecated.Deprecated. Please use setWarningLevel(DiagnosticGroups.GLOBAL_THIS, level) instead.
-
setCheckMissingGetCssNameLevel
public void setCheckMissingGetCssNameLevel(CheckLevel level)
Checks that certain string literals only appear in strings used as goog.getCssName arguments.
-
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 public boolean shouldCollapseProperties()
Deprecated.use getPropertyCollapseLevelFlattens multi-level property names (e.g. a$b = x)
-
getPropertyCollapseLevel
public CompilerOptions.PropertyCollapseLevel getPropertyCollapseLevel()
-
setCollapseObjectLiterals
public void setCollapseObjectLiterals(boolean enabled)
-
getCollapseObjectLiterals
public boolean getCollapseObjectLiterals()
-
setNameGenerator
public void setNameGenerator(com.google.javascript.jscomp.NameGenerator nameGenerator)
-
setReplaceMessagesWithChromeI18n
public void setReplaceMessagesWithChromeI18n(boolean replaceMessagesWithChromeI18n, java.lang.String tcProjectId)
-
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
public void setFilesToPrintAfterEachPassRegexList(java.util.List<java.lang.String> filePathRegexList)
-
setChunksToPrintAfterEachPassRegexList
public void setChunksToPrintAfterEachPassRegexList(java.util.List<java.lang.String> chunkPathRegexList)
-
setModulesToPrintAfterEachPassRegexList
@Deprecated public void setModulesToPrintAfterEachPassRegexList(java.util.List<java.lang.String> chunkPathRegexList)
Deprecated.
-
getTracerMode
public CompilerOptions.TracerMode getTracerMode()
-
setTracerMode
public void setTracerMode(CompilerOptions.TracerMode mode)
-
setTracerOutput
public void setTracerOutput(java.nio.file.Path out)
-
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()
-
setAssumeStaticInheritanceRequired
public void setAssumeStaticInheritanceRequired(boolean x)
-
getAssumeStaticInheritanceRequired
public boolean getAssumeStaticInheritanceRequired()
-
setConformanceRemoveRegexFromPath
public void setConformanceRemoveRegexFromPath(com.google.common.base.Optional<java.util.regex.Pattern> pattern)
-
getConformanceRemoveRegexFromPath
public com.google.common.base.Optional<java.util.regex.Pattern> 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 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
.
-
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
public java.util.Map<java.lang.String,Node> getDefineReplacements()
Returns the map of define replacements.
-
getTweakReplacements
public java.util.Map<java.lang.String,Node> getTweakReplacements()
Returns the map of tweak replacements.
-
setDefineToBooleanLiteral
public void setDefineToBooleanLiteral(java.lang.String defineName, boolean value)
Sets the value of the@define
variable in JS to a boolean literal.
-
setDefineToStringLiteral
public void setDefineToStringLiteral(java.lang.String defineName, java.lang.String value)
Sets the value of the@define
variable in JS to a String literal.
-
setDefineToNumberLiteral
public void setDefineToNumberLiteral(java.lang.String defineName, int value)
Sets the value of the@define
variable in JS to a number literal.
-
setDefineToDoubleLiteral
public void setDefineToDoubleLiteral(java.lang.String defineName, double value)
Sets the value of the@define
variable in JS to a number literal.
-
setTweakToBooleanLiteral
public void setTweakToBooleanLiteral(java.lang.String tweakId, boolean value)
Sets the value of the tweak in JS to a boolean literal.
-
setTweakToStringLiteral
public void setTweakToStringLiteral(java.lang.String tweakId, java.lang.String value)
Sets the value of the tweak in JS to a String literal.
-
setTweakToNumberLiteral
public void setTweakToNumberLiteral(java.lang.String tweakId, int value)
Sets the value of the tweak in JS to a number literal.
-
setTweakToDoubleLiteral
public void setTweakToDoubleLiteral(java.lang.String tweakId, double value)
Sets the value of the tweak in JS to a number literal.
-
skipAllCompilerPasses
public void skipAllCompilerPasses()
Skip all possible passes, to make the compiler as fast as possible.
-
setWarningLevel
public void setWarningLevel(DiagnosticGroup type, CheckLevel level)
Configure the given type of warning to the given level.
-
resetWarningsGuard
public void resetWarningsGuard()
Reset the warnings guard.
-
addWarningsGuard
public void addWarningsGuard(WarningsGuard guard)
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.
-
setShadowVariables
@Deprecated public void setShadowVariables(boolean shadow)
Deprecated.Should shadow outer scope variable name during renaming.
-
setReplaceIdGenerators
public void setReplaceIdGenerators(boolean replaceIdGenerators)
- Parameters:
replaceIdGenerators
- the replaceIdGenerators to set
-
setIdGenerators
public void setIdGenerators(java.util.Set<java.lang.String> idGenerators)
Sets the id generators to replace.
-
setIdGenerators
public void setIdGenerators(java.util.Map<java.lang.String,RenamingMap> idGenerators)
Sets the id generators to replace.
-
setIdGeneratorsMap
public void setIdGeneratorsMap(java.lang.String previousMappings)
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
public void setXidHashFunction(Xid.HashFunction xidHashFunction)
Sets the hash function to use for Xid
-
setInlineFunctions
@Deprecated public void setInlineFunctions(boolean inlineFunctions)
Deprecated.UsesetInlineFunctions(Reach)
instead
-
setInlineFunctions
public void setInlineFunctions(CompilerOptions.Reach reach)
Set the function inlining policy for the compiler.
-
getInlineFunctionsLevel
public CompilerOptions.Reach getInlineFunctionsLevel()
Get the function inlining policy for the compiler.
-
setMaxFunctionSizeAfterInlining
public void setMaxFunctionSizeAfterInlining(int funAstSize)
-
setInlineVariables
public void setInlineVariables(boolean inlineVariables)
-
setInlineVariables
public void setInlineVariables(CompilerOptions.Reach reach)
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
public void setRemoveUnusedVariables(CompilerOptions.Reach reach)
Set the variable removal policy for the compiler.
-
setReplaceStringsConfiguration
public void setReplaceStringsConfiguration(java.lang.String placeholderToken, java.util.List<java.lang.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()
-
enableRuntimeTypeCheck
public void enableRuntimeTypeCheck(java.lang.String logFunction)
Enable run-time type checking, which adds JS type assertions for debugging.- Parameters:
logFunction
- A JS function to be used for logging run-time type assertion failures.
-
disableRuntimeTypeCheck
public void disableRuntimeTypeCheck()
-
setChecksOnly
public void setChecksOnly(boolean checksOnly)
-
setOutputJs
public void setOutputJs(CompilerOptions.OutputJs outputJs)
-
setGenerateExports
public void setGenerateExports(boolean generateExports)
-
setExportLocalPropertyDefinitions
public void setExportLocalPropertyDefinitions(boolean export)
-
shouldExportLocalPropertyDefinitions
public boolean shouldExportLocalPropertyDefinitions()
-
setAngularPass
public void setAngularPass(boolean angularPass)
-
setPolymerVersion
public void setPolymerVersion(java.lang.Integer polymerVersion)
-
setPolymerExportPolicy
public void setPolymerExportPolicy(PolymerExportPolicy polymerExportPolicy)
-
setChromePass
public void setChromePass(boolean chromePass)
-
isChromePassEnabled
public boolean isChromePassEnabled()
-
setDartPass
public void setDartPass(boolean dartPass)
-
setJ2clPass
public void setJ2clPass(CompilerOptions.J2clPassMode j2clPassMode)
-
setJ2clMinifierEnabled
public void setJ2clMinifierEnabled(boolean enabled)
-
setJ2clMinifierPruningManifest
public void setJ2clMinifierPruningManifest(java.lang.String j2clMinifierPruningManifest)
-
setCodingConvention
public void setCodingConvention(CodingConvention codingConvention)
-
getCodingConvention
public CodingConvention getCodingConvention()
-
setDependencyOptions
public void setDependencyOptions(DependencyOptions dependencyOptions)
Sets the dependency management options.
-
getDependencyOptions
public DependencyOptions 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, see --check_types), 3 (always print summary). The default level is 1
-
setExtraAnnotationNames
public void setExtraAnnotationNames(java.lang.Iterable<java.lang.String> extraAnnotationNames)
-
isExternExportsEnabled
public boolean isExternExportsEnabled()
-
setOutputCharset
public void setOutputCharset(java.nio.charset.Charset charset)
Sets the output charset.
-
setTweakProcessing
public void setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets how goog.tweak calls are processed.
-
getTweakProcessing
public CompilerOptions.TweakProcessing getTweakProcessing()
-
setLanguage
public void setLanguage(CompilerOptions.LanguageMode language)
Sets ECMAScript version to use.
-
setLanguageIn
public void setLanguageIn(CompilerOptions.LanguageMode languageIn)
Sets ECMAScript version to use for the input. If you are not transpiling from one version to another, use #setLanguage instead.
-
getLanguageIn
public CompilerOptions.LanguageMode getLanguageIn()
-
setLanguageOut
public void setLanguageOut(CompilerOptions.LanguageMode languageOut)
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.
-
setOutputFeatureSet
public void setOutputFeatureSet(FeatureSet featureSet)
Sets the features that allowed to appear in the output. Any feature in the input that is not in this output must be transpiled away.
-
getOutputFeatureSet
public FeatureSet getOutputFeatureSet()
Gets the set of features that can appear in the output.
-
needsTranspilationFrom
public boolean needsTranspilationFrom(FeatureSet languageLevel)
-
needsTranspilationOf
public boolean needsTranspilationOf(FeatureSet.Feature feature)
-
setEnvironment
public void setEnvironment(CompilerOptions.Environment environment)
Set which set of builtin externs to use.
-
getEnvironment
public CompilerOptions.Environment getEnvironment()
-
setAliasTransformationHandler
public void setAliasTransformationHandler(CompilerOptions.AliasTransformationHandler changes)
-
getAliasTransformationHandler
public CompilerOptions.AliasTransformationHandler getAliasTransformationHandler()
-
setErrorHandler
public void setErrorHandler(ErrorHandler handler)
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 public void setNewTypeInference(boolean enable)
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.
-
setPropertyInvalidationErrors
public void setPropertyInvalidationErrors(java.util.Map<java.lang.String,CheckLevel> propertyInvalidationErrors)
Sets the list of properties that we report property invalidation errors for.
-
setAllowHotswapReplaceScript
public void setAllowHotswapReplaceScript(boolean allowRecompilation)
-
setPreserveDetailedSourceInfo
public void setPreserveDetailedSourceInfo(boolean preserveDetailedSourceInfo)
-
setPreserveNonJSDocComments
public void setPreserveNonJSDocComments(boolean preserveNonJSDocComments)
-
setContinueAfterErrors
public void setContinueAfterErrors(boolean continueAfterErrors)
-
setParseJsDocDocumentation
public 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. By default, whitespace is collapsed for all comments except @license and @preserve blocks,
-
isParseJsDocDocumentation
public Config.JsDocParsing 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
public void setDevMode(CompilerOptions.DevMode devMode)
-
setCheckDeterminism
public void setCheckDeterminism(boolean checkDeterminism)
-
getCheckDeterminism
public boolean getCheckDeterminism()
-
setMessageBundle
public void setMessageBundle(MessageBundle messageBundle)
-
setCheckSymbols
public void setCheckSymbols(boolean checkSymbols)
-
setCheckSuspiciousCode
public void setCheckSuspiciousCode(boolean checkSuspiciousCode)
-
setCheckTypes
public void setCheckTypes(boolean checkTypes)
-
setCheckMissingGetCssNameBlacklist
public void setCheckMissingGetCssNameBlacklist(java.lang.String blackList)
-
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)
-
setExtraSmartNameRemoval
public void setExtraSmartNameRemoval(boolean smartNameRemoval)
-
setRemoveDeadCode
public void setRemoveDeadCode(boolean removeDeadCode)
-
setExtractPrototypeMemberDeclarations
public void setExtractPrototypeMemberDeclarations(boolean enabled)
-
setExtractPrototypeMemberDeclarations
public void setExtractPrototypeMemberDeclarations(CompilerOptions.ExtractPrototypeMemberDeclarationsMode mode)
-
setRemoveUnusedPrototypeProperties
public void setRemoveUnusedPrototypeProperties(boolean enabled)
-
setRemoveUnusedPrototypePropertiesInExterns
public void setRemoveUnusedPrototypePropertiesInExterns(boolean enabled)
-
setCollapseVariableDeclarations
public void setCollapseVariableDeclarations(boolean enabled)
-
setCollapseAnonymousFunctions
public void setCollapseAnonymousFunctions(boolean enabled)
-
setAliasableStrings
public void setAliasableStrings(java.util.Set<java.lang.String> aliasableStrings)
-
setAliasStringsBlacklist
public void setAliasStringsBlacklist(java.lang.String aliasStringsBlacklist)
-
setAliasAllStrings
public void setAliasAllStrings(boolean aliasAllStrings)
-
setOutputJsStringUsage
public void setOutputJsStringUsage(boolean outputJsStringUsage)
-
setConvertToDottedProperties
public void setConvertToDottedProperties(boolean convertToDottedProperties)
-
setUseTypesForLocalOptimization
public void setUseTypesForLocalOptimization(boolean useTypesForLocalOptimization)
-
shouldUseTypesForLocalOptimization
public boolean shouldUseTypesForLocalOptimization()
-
setUseTypesForOptimization
@Deprecated public void setUseTypesForOptimization(boolean useTypesForOptimization)
Deprecated.
-
setRewriteFunctionExpressions
public void setRewriteFunctionExpressions(boolean rewriteFunctionExpressions)
-
setOptimizeCalls
public void setOptimizeCalls(boolean optimizeCalls)
-
setOptimizeArgumentsArray
public void setOptimizeArgumentsArray(boolean optimizeArgumentsArray)
-
setVariableRenaming
public void setVariableRenaming(VariableRenamingPolicy variableRenaming)
-
setPropertyRenaming
public void setPropertyRenaming(PropertyRenamingPolicy propertyRenaming)
-
getPropertyRenaming
public PropertyRenamingPolicy 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)
-
setRenamePrefix
public void setRenamePrefix(java.lang.String renamePrefix)
-
getRenamePrefixNamespace
public java.lang.String getRenamePrefixNamespace()
-
setRenamePrefixNamespace
public void setRenamePrefixNamespace(java.lang.String renamePrefixNamespace)
-
setCollapsePropertiesLevel
public void setCollapsePropertiesLevel(CompilerOptions.PropertyCollapseLevel level)
-
setCollapseProperties
@Deprecated public void setCollapseProperties(boolean fullyCollapse)
Deprecated.
-
setDevirtualizeMethods
public void setDevirtualizeMethods(boolean devirtualizeMethods)
-
setComputeFunctionSideEffects
public void setComputeFunctionSideEffects(boolean computeFunctionSideEffects)
-
setDisambiguateProperties
public void setDisambiguateProperties(boolean disambiguateProperties)
-
shouldDisambiguateProperties
public boolean shouldDisambiguateProperties()
-
setUseGraphBasedDisambiguator
public void setUseGraphBasedDisambiguator(boolean x)
-
shouldUseGraphBasedDisambiguator
public boolean shouldUseGraphBasedDisambiguator()
-
setAmbiguateProperties
public void setAmbiguateProperties(boolean ambiguateProperties)
-
shouldAmbiguateProperties
public boolean shouldAmbiguateProperties()
-
setAnonymousFunctionNaming
public void setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming)
-
setInputAnonymousFunctionNamingMap
public void setInputAnonymousFunctionNamingMap(VariableMap inputMap)
-
setInputVariableMap
public void setInputVariableMap(VariableMap inputVariableMap)
-
setInputPropertyMap
public void setInputPropertyMap(VariableMap inputPropertyMap)
-
setExportTestFunctions
public void setExportTestFunctions(boolean exportTestFunctions)
-
setRuntimeTypeCheck
public void setRuntimeTypeCheck(boolean runtimeTypeCheck)
-
setRuntimeTypeCheckLogFunction
public void setRuntimeTypeCheckLogFunction(java.lang.String runtimeTypeCheckLogFunction)
-
setSyntheticBlockStartMarker
public void setSyntheticBlockStartMarker(java.lang.String syntheticBlockStartMarker)
-
setSyntheticBlockEndMarker
public void setSyntheticBlockEndMarker(java.lang.String syntheticBlockEndMarker)
-
setLocale
public void setLocale(java.lang.String locale)
-
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)
-
setGatherCssNames
public void setGatherCssNames(boolean gatherCssNames)
-
setStripTypes
public void setStripTypes(java.util.Set<java.lang.String> stripTypes)
-
setStripNameSuffixes
public void setStripNameSuffixes(java.util.Set<java.lang.String> stripNameSuffixes)
-
setStripNamePrefixes
public void setStripNamePrefixes(java.util.Set<java.lang.String> stripNamePrefixes)
-
setStripTypePrefixes
public void setStripTypePrefixes(java.util.Set<java.lang.String> stripTypePrefixes)
-
addCustomPass
public void addCustomPass(CustomPassExecutionTime time, CompilerPass customPass)
-
setDefineReplacements
public void setDefineReplacements(java.util.Map<java.lang.String,java.lang.Object> defineReplacements)
-
setTweakReplacements
public void setTweakReplacements(java.util.Map<java.lang.String,java.lang.Object> tweakReplacements)
-
setMoveFunctionDeclarations
public void setMoveFunctionDeclarations(boolean moveFunctionDeclarations)
-
setCssRenamingMap
public void setCssRenamingMap(CssRenamingMap cssRenamingMap)
-
setCssRenamingWhitelist
@Deprecated public void setCssRenamingWhitelist(java.util.Set<java.lang.String> skiplist)
Deprecated.
-
setCssRenamingSkiplist
public void setCssRenamingSkiplist(java.util.Set<java.lang.String> skiplist)
-
setReplaceStringsFunctionDescriptions
public void setReplaceStringsFunctionDescriptions(java.util.List<java.lang.String> replaceStringsFunctionDescriptions)
-
setReplaceStringsPlaceholderToken
public void setReplaceStringsPlaceholderToken(java.lang.String replaceStringsPlaceholderToken)
-
setReplaceStringsReservedStrings
public void setReplaceStringsReservedStrings(java.util.Set<java.lang.String> replaceStringsReservedStrings)
-
setReplaceStringsInputMap
public void setReplaceStringsInputMap(VariableMap serializedMap)
-
setPrettyPrint
public void setPrettyPrint(boolean prettyPrint)
-
isPrettyPrint
public boolean isPrettyPrint()
-
setLineBreak
public void setLineBreak(boolean lineBreak)
-
getPreferLineBreakAtEndOfFile
public boolean getPreferLineBreakAtEndOfFile()
-
setPreferLineBreakAtEndOfFile
public void setPreferLineBreakAtEndOfFile(boolean lineBreakAtEnd)
-
setPrintInputDelimiter
public void setPrintInputDelimiter(boolean printInputDelimiter)
-
setInputDelimiter
public void setInputDelimiter(java.lang.String inputDelimiter)
-
setDebugLogDirectory
public void setDebugLogDirectory(@Nullable java.nio.file.Path dir)
-
getDebugLogDirectory
@Nullable public java.nio.file.Path getDebugLogDirectory()
-
setQuoteKeywordProperties
public void setQuoteKeywordProperties(boolean quoteKeywordProperties)
-
shouldQuoteKeywordProperties
public boolean shouldQuoteKeywordProperties()
-
setErrorFormat
public void setErrorFormat(ErrorFormat errorFormat)
-
getErrorFormat
public ErrorFormat getErrorFormat()
-
setWarningsGuard
public void setWarningsGuard(ComposeWarningsGuard warningsGuard)
-
setLineLengthThreshold
public void setLineLengthThreshold(int lineLengthThreshold)
-
getLineLengthThreshold
public int getLineLengthThreshold()
-
setUseOriginalNamesInOutput
public void setUseOriginalNamesInOutput(boolean useOriginalNamesInOutput)
-
getUseOriginalNamesInOutput
public boolean getUseOriginalNamesInOutput()
-
setExternExports
public void setExternExports(boolean externExports)
-
setExternExportsPath
public void setExternExportsPath(java.lang.String externExportsPath)
-
setSourceMapOutputPath
public void setSourceMapOutputPath(java.lang.String sourceMapOutputPath)
-
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
public void setSourceMapDetailLevel(SourceMap.DetailLevel sourceMapDetailLevel)
-
setSourceMapFormat
public void setSourceMapFormat(SourceMap.Format sourceMapFormat)
-
setSourceMapLocationMappings
public void setSourceMapLocationMappings(java.util.List<? extends SourceMap.LocationMapping> sourceMapLocationMappings)
-
setTransformAMDToCJSModules
public void setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
Activates transformation of AMD to CommonJS modules.
-
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
public void setEs6ModuleTranspilation(CompilerOptions.Es6ModuleTranspilation value)
-
getEs6ModuleTranspilation
public CompilerOptions.Es6ModuleTranspilation getEs6ModuleTranspilation()
-
setCommonJSModulePathPrefix
public void setCommonJSModulePathPrefix(java.lang.String commonJSModulePathPrefix)
Sets a path prefix for CommonJS modules (maps tosetModuleRoots(List)
).
-
setModuleRoots
public void setModuleRoots(java.util.List<java.lang.String> moduleRoots)
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()
-
setForceLibraryInjection
public void setForceLibraryInjection(java.lang.Iterable<java.lang.String> libraries)
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.
-
setInstrumentForCoverage
public void setInstrumentForCoverage(boolean instrumentForCoverage)
Set whether or not code should be modified to provide coverage information.
-
setInstrumentBranchCoverage
public void setInstrumentBranchCoverage(boolean instrumentBranchCoverage)
Set whether to instrument to collect branch coverage
-
setInstrumentForCoverageOption
public void setInstrumentForCoverageOption(CompilerOptions.InstrumentOption instrumentForCoverageOption)
-
getInstrumentForCoverageOption
public CompilerOptions.InstrumentOption getInstrumentForCoverageOption()
-
getConformanceConfigs
public final com.google.common.collect.ImmutableList<ConformanceConfig> getConformanceConfigs()
-
setConformanceConfig
@GwtIncompatible("Conformance") public void setConformanceConfig(ConformanceConfig conformanceConfig)
Both enable and configure conformance checks, if non-null.
-
setConformanceConfigs
@GwtIncompatible("Conformance") public void setConformanceConfigs(java.util.List<ConformanceConfig> configs)
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
public CompilerOptions setEmitUseStrict(boolean emitUseStrict)
-
getModuleResolutionMode
public ModuleLoader.ResolutionMode getModuleResolutionMode()
-
setModuleResolutionMode
public void setModuleResolutionMode(ModuleLoader.ResolutionMode moduleResolutionMode)
-
getBrowserResolverPrefixReplacements
public com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> getBrowserResolverPrefixReplacements()
-
setBrowserResolverPrefixReplacements
public void setBrowserResolverPrefixReplacements(com.google.common.collect.ImmutableMap<java.lang.String,java.lang.String> browserResolverPrefixReplacements)
-
setPathEscaper
public void setPathEscaper(ModuleLoader.PathEscaper pathEscaper)
-
getPathEscaper
public ModuleLoader.PathEscaper getPathEscaper()
-
getPackageJsonEntryNames
public java.util.List<java.lang.String> getPackageJsonEntryNames()
-
setPackageJsonEntryNames
public void setPackageJsonEntryNames(java.util.List<java.lang.String> names)
-
setUseSizeHeuristicToStopOptimizationLoop
public void setUseSizeHeuristicToStopOptimizationLoop(boolean mayStopEarly)
-
setMaxOptimizationLoopIterations
public void setMaxOptimizationLoopIterations(int maxIterations)
-
serialize
@GwtIncompatible("ObjectOutputStream") public void serialize(java.io.OutputStream objectOutputStream) throws java.io.IOException
Serializes compiler options to a stream.- Throws:
java.io.IOException
-
deserialize
@GwtIncompatible("ObjectInputStream") public static CompilerOptions deserialize(java.io.InputStream objectInputStream) throws java.io.IOException, java.lang.ClassNotFoundException
Deserializes compiler options from a stream.- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
expectStrictModeInput
public boolean expectStrictModeInput()
-
setStrictModeInput
public CompilerOptions setStrictModeInput(boolean isStrictModeInput)
-
getPropertyReservedNamingFirstChars
public char[] getPropertyReservedNamingFirstChars()
-
getPropertyReservedNamingNonFirstChars
public char[] getPropertyReservedNamingNonFirstChars()
-
-