Package com.google.javascript.jscomp
Class CompilerOptions
- java.lang.Object
-
- com.google.javascript.jscomp.CompilerOptions
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class CompilerOptions extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable
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.LanguageMode
When to do the extra sanity checksstatic class
CompilerOptions.Reach
static class
CompilerOptions.TracerMode
static class
CompilerOptions.TweakProcessing
-
Field Summary
Fields Modifier and Type Field Description CheckLevel
aggressiveVarCheck
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)boolean
aliasExternals
Adds variable aliases for externals to reduce code sizeboolean
aliasKeywords
Aliases true, false, and null to variables with shorter names.java.lang.String
aliasStringsBlacklist
A blacklist in the form of a regular expression to block strings that contains certain words from being aliased.boolean
ambiguateProperties
Rename unrelated properties to the same name to reduce code size.AnonymousFunctionNamingPolicy
anonymousFunctionNaming
Give anonymous functions names for easier debuggingCheckLevel
brokenClosureRequiresLevel
boolean
checkControlStructures
Checks for invalid control structuresCheckLevel
checkGlobalNamesLevel
CheckLevel
checkGlobalThisLevel
java.lang.String
checkMissingGetCssNameBlacklist
Regex of string literals that may only appear in goog.getCssName arguments.CheckLevel
checkMissingGetCssNameLevel
CheckLevel
checkMissingReturn
CheckLevel
checkProvides
CheckLevel
checkRequires
Checks for missing goog.require() callsboolean
checkSuspiciousCode
Checks for suspicious statements that have no effectboolean
checkSymbols
Checks that all symbols are definedboolean
checkTypes
Checks types on expressionsCheckLevel
checkUnreachableCode
boolean
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
collapseProperties
Flattens multi-level property names (e.g.boolean
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)boolean
crossModuleCodeMotion
Move code to a deeper moduleboolean
crossModuleMethodMotion
Move methods to a deeper moduleCssRenamingMap
cssRenamingMap
Map used in the renaming of CSS class names.com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass>
customPasses
Custom passesboolean
deadAssignmentElimination
Remove assignments to values that can not be referencedboolean
devirtualizePrototypeMethods
Devirtualize prototype method by rewriting them to be static calls that take the this pointer as their first argumentboolean
disambiguateProperties
Rename properties to disambiguate between unrelated fields based on type information.ErrorFormat
errorFormat
boolean
exportTestFunctions
Whether to export test functions.boolean
extractPrototypeMemberDeclarations
Extracts common prototype member declarationsboolean
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
ideMode
Configures the compiler for use as an IDE backend.boolean
inlineConstantVars
Inlines constants (symbols that are all CAPS)boolean
inlineFunctions
Inlines global functionsboolean
inlineGetters
Inlines trivial gettersboolean
inlineLocalFunctions
Inlines functions defined in local scopesboolean
inlineVariables
Inlines variablesjava.lang.String
inputDelimiter
The string to use as the separator for printInputDelimiterjava.lang.String
instrumentationTemplate
Instrumentation template to use with #recordFunctionInformationboolean
jqueryPass
Processes jQuery aliasesboolean
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 trueboolean
markNoSideEffectCalls
Mark no side effect callsMessageBundle
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
optimizeParameters
Remove unused and constant parameters.boolean
optimizeReturns
Remove unused return values.boolean
preferLineBreakAtEndOfFile
Prefer line breaks at end of fileboolean
prettyPrint
Output in pretty indented formatboolean
printInputDelimiter
Prints a separator comment before each JS scriptPropertyRenamingPolicy
propertyRenaming
Controls which properties get renamed.boolean
recordFunctionInformation
Record function informationboolean
removeDeadCode
Removes code that will never executeboolean
removeTryCatchFinally
Removes try...catch...finally blocks for easier debuggingboolean
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.CheckLevel
reportMissingOverride
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<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 Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addWarningsGuard(WarningsGuard guard)
Add a guard to the set of warnings guards.boolean
assumeClosuresOnlyCaptureReferences()
boolean
assumeStrictThis()
java.lang.Object
clone()
void
disableRuntimeTypeCheck()
void
enableExternExports(boolean enabled)
Deprecated.replaced bysetExternExports(boolean)
void
enableRuntimeTypeCheck(java.lang.String logFunction)
Enable run-time type checking, which adds JS type assertions for debugging.CompilerOptions.AliasTransformationHandler
getAliasTransformationHandler()
boolean
getCheckDeterminism()
CodingConvention
getCodingConvention()
java.util.Map<java.lang.String,Node>
getDefineReplacements()
Returns the map of define replacements.boolean
getInferTypes()
Gets the inferTypes flag.CompilerOptions.LanguageMode
getLanguageIn()
CompilerOptions.LanguageMode
getLanguageOut()
CompilerOptions.TracerMode
getTracerMode()
CompilerOptions.TweakProcessing
getTweakProcessing()
java.util.Map<java.lang.String,Node>
getTweakReplacements()
Returns the map of tweak replacements.boolean
isExternExportsEnabled()
boolean
isRemoveUnusedClassProperties()
void
resetWarningsGuard()
Reset the warnings guard.void
setAcceptConstKeyword(boolean value)
If true, accept `const' keyword.void
setAggressiveVarCheck(CheckLevel level)
Checks for suspicious variable definitions and undefined variablesvoid
setAliasableGlobals(java.lang.String names)
A comma separated white-list of global names.void
setAliasableStrings(java.util.Set<java.lang.String> aliasableStrings)
void
setAliasAllStrings(boolean aliasAllStrings)
void
setAliasExternals(boolean aliasExternals)
void
setAliasKeywords(boolean aliasKeywords)
void
setAliasStringsBlacklist(java.lang.String aliasStringsBlacklist)
void
setAliasTransformationHandler(CompilerOptions.AliasTransformationHandler changes)
void
setAmbiguateProperties(boolean ambiguateProperties)
void
setAngularPass(boolean angularPass)
void
setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming)
void
setAppNameStr(java.lang.String appNameStr)
App identifier string for use by the instrumentation template's app_name_setter.void
setAssumeClosuresOnlyCaptureReferences(boolean enable)
Whether to assume closures capture only what they reference.void
setAssumeStrictThis(boolean enable)
If true, enables enables additional optimizations.void
setBrokenClosureRequiresLevel(CheckLevel level)
Sets the check level for bad Closure require calls.void
setChainCalls(boolean value)
If true, chain calls to functions that return this.void
setCheckCaja(boolean check)
void
setCheckControlStructures(boolean checkControlStructures)
void
setCheckDeterminism(boolean checkDeterminism)
void
setCheckGlobalNamesLevel(CheckLevel level)
Checks the integrity of references to qualified global names.void
setCheckGlobalThisLevel(CheckLevel level)
Checks for certain uses of thethis
keyword that are considered unsafe because they are likely to reference the globalthis
object unintentionally.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
setCheckMissingReturn(CheckLevel level)
Checks for missing return statementsvoid
setCheckProvides(CheckLevel level)
Checks for missing goog.provides() callsvoid
setCheckRequires(CheckLevel level)
void
setCheckSuspiciousCode(boolean checkSuspiciousCode)
void
setCheckSymbols(boolean checkSymbols)
void
setCheckTypes(boolean checkTypes)
void
setCheckUnreachableCode(CheckLevel level)
Checks for unreachable codevoid
setClosurePass(boolean closurePass)
void
setCoalesceVariableNames(boolean coalesceVariableNames)
void
setCodingConvention(CodingConvention codingConvention)
void
setCollapseAnonymousFunctions(boolean enabled)
void
setCollapseObjectLiterals(boolean enabled)
void
setCollapseProperties(boolean collapseProperties)
void
setCollapsePropertiesOnExternTypes(boolean collapse)
If true, flattens multi-level property names on extern types (e.g.void
setCollapseVariableDeclarations(boolean enabled)
void
setColorizeErrorOutput(boolean colorizeErrorOutput)
void
setCommonJSModulePathPrefix(java.lang.String commonJSModulePathPrefix)
Sets a path prefix for CommonJS modules.void
setComputeFunctionSideEffects(boolean computeFunctionSideEffects)
void
setConvertToDottedProperties(boolean convertToDottedProperties)
void
setCrossModuleCodeMotion(boolean crossModuleCodeMotion)
void
setCrossModuleMethodMotion(boolean crossModuleMethodMotion)
void
setCssRenamingMap(CssRenamingMap cssRenamingMap)
void
setCssRenamingWhitelist(java.util.Set<java.lang.String> whitelist)
void
setCustomPasses(com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses)
void
setDeadAssignmentElimination(boolean deadAssignmentElimination)
void
setDebugFunctionSideEffectsPath(java.lang.String debugFunctionSideEffectsPath)
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 options)
Sets dependency options.void
setDevirtualizePrototypeMethods(boolean devirtualizePrototypeMethods)
void
setDevMode(com.google.javascript.jscomp.CompilerOptions.DevMode devMode)
void
setDisambiguateProperties(boolean disambiguateProperties)
void
setErrorFormat(ErrorFormat errorFormat)
void
setErrorHandler(ErrorHandler handler)
Set a custom handler for warnings and errors.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
setFlowSensitiveInlineVariables(boolean enabled)
void
setFoldConstants(boolean foldConstants)
void
setGatherCssNames(boolean gatherCssNames)
void
setGenerateExports(boolean generateExports)
void
setGeneratePseudoNames(boolean generatePseudoNames)
void
setGroupVariableDeclarations(boolean enabled)
void
setIdeMode(boolean ideMode)
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
setIgnoreCajaProperties(boolean enabled)
Add code to skip properties that Caja adds to Object.prototypevoid
setInferTypes(boolean enable)
If true, enables type inference.void
setInlineConstantVars(boolean inlineConstantVars)
void
setInlineFunctions(boolean inlineFunctions)
void
setInlineFunctions(CompilerOptions.Reach reach)
Set the function inlining policy for the compiler.void
setInlineGetters(boolean inlineGetters)
void
setInlineLocalFunctions(boolean inlineLocalFunctions)
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
setInputPropertyMapSerialized(byte[] inputPropertyMapSerialized)
Deprecated.void
setInputVariableMap(VariableMap inputVariableMap)
void
setInputVariableMapSerialized(byte[] inputVariableMapSerialized)
Deprecated.void
setInstrumentationTemplate(java.lang.String instrumentationTemplate)
void
setLabelRenaming(boolean labelRenaming)
void
setLanguageIn(CompilerOptions.LanguageMode languageIn)
Sets how goog.tweak calls are processed.void
setLanguageOut(CompilerOptions.LanguageMode languageOut)
void
setLineBreak(boolean lineBreak)
void
setLineLengthThreshold(int lineLengthThreshold)
void
setLocale(java.lang.String locale)
void
setLooseTypes(boolean looseTypes)
Whether to include "undefined" in the default types.void
setManageClosureDependencies(boolean newVal)
Sort inputs by their goog.provide/goog.require calls, and prune inputs whose symbols are not required.void
setManageClosureDependencies(java.util.List<java.lang.String> entryPoints)
Sort inputs by their goog.provide/goog.require calls.void
setMarkAsCompiled(boolean markAsCompiled)
void
setMarkNoSideEffectCalls(boolean markNoSideEffectCalls)
void
setMessageBundle(MessageBundle messageBundle)
void
setMoveFunctionDeclarations(boolean moveFunctionDeclarations)
void
setNameAnonymousFunctionsOnly(boolean value)
If true, name anonymous functions only.void
setNameReferenceGraphPath(java.lang.String filePath)
Where to save the name reference graphvoid
setNameReferenceReportPath(java.lang.String filePath)
Where to save a cross-reference report from the name reference graphvoid
setOptimizeArgumentsArray(boolean optimizeArgumentsArray)
void
setOptimizeCalls(boolean optimizeCalls)
void
setOptimizeParameters(boolean optimizeParameters)
void
setOptimizeReturns(boolean optimizeReturns)
void
setOutputCharset(java.lang.String charsetName)
Sets the output charset by name.void
setOutputJsStringUsage(boolean outputJsStringUsage)
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
setPrettyPrint(boolean prettyPrint)
void
setPrintInputDelimiter(boolean printInputDelimiter)
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
setProcessObjectPropertyString(boolean process)
If true, process goog.testing.ObjectPropertyString instances.void
setPropertyAffinity(boolean useAffinity)
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
setRecordFunctionInformation(boolean recordFunctionInformation)
void
setRemoveAbstractMethods(boolean remove)
void
setRemoveClosureAsserts(boolean remove)
void
setRemoveDeadCode(boolean removeDeadCode)
void
setRemoveTryCatchFinally(boolean removeTryCatchFinally)
void
setRemoveUnusedClassProperties(boolean removeUnusedClassProperties)
void
setRemoveUnusedLocalVars(boolean removeUnusedLocalVars)
void
setRemoveUnusedPrototypeProperties(boolean enabled)
void
setRemoveUnusedPrototypePropertiesInExterns(boolean enabled)
void
setRemoveUnusedVariable(CompilerOptions.Reach reach)
Deprecated.void
setRemoveUnusedVariables(CompilerOptions.Reach reach)
Set the variable removal policy for the compiler.void
setRemoveUnusedVars(boolean removeUnusedVars)
void
setRenamePrefix(java.lang.String renamePrefix)
void
setRenamePrefixNamespace(java.lang.String renamePrefixNamespace)
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.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
setReportMissingOverride(CheckLevel level)
Flags a warning if a property is missing the @override annotation, but it overrides a base class property.void
setReportPath(java.lang.String reportPath)
Where to save a report of global name usagevoid
setReportUnknownTypes(CheckLevel level)
Flags a warning for every node whose type could not be determined.void
setReserveRawExports(boolean reserveRawExports)
void
setRewriteFunctionExpressions(boolean rewriteFunctionExpressions)
void
setRewriteNewDateGoogNow(boolean rewrite)
Deprecated.void
setRuntimeTypeCheck(boolean runtimeTypeCheck)
void
setRuntimeTypeCheckLogFunction(java.lang.String runtimeTypeCheckLogFunction)
void
setSaveDataStructures(boolean save)
Whether to keep internal data structures around after we're finished compiling.void
setShadowVariables(boolean shadow)
Should shadow outer scope variable name during renaming.void
setSkipAllPasses(boolean skipAllPasses)
void
setSmartNameRemoval(boolean smartNameRemoval)
void
setSourceMapDetailLevel(SourceMap.DetailLevel sourceMapDetailLevel)
void
setSourceMapFormat(SourceMap.Format sourceMapFormat)
void
setSourceMapLocationMappings(java.util.List<SourceMap.LocationMapping> sourceMapLocationMappings)
void
setSourceMapOutputPath(java.lang.String sourceMapOutputPath)
void
setSpecializeInitialModule(boolean enabled)
Specialize the initial module at the cost of later modulesvoid
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
setTightenTypes(boolean tighten)
Tightens types based on a global analysis.void
setTracer(CompilerOptions.TracerMode tracer)
void
setTracerMode(CompilerOptions.TracerMode mode)
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
setUnaliasableGlobals(java.lang.String names)
A comma separated white-list of global names.void
setVariableRenaming(VariableRenamingPolicy variableRenaming)
void
setWarningLevel(DiagnosticGroup type, CheckLevel level)
Configure the given type of warning to the given level.void
setWarningsGuard(ComposeWarningsGuard warningsGuard)
boolean
shouldColorizeErrorOutput()
void
skipAllCompilerPasses()
Skip all possible passes, to make the compiler as fast as possible.
-
-
-
Field Detail
-
ideMode
public boolean ideMode
Configures the compiler for use as an IDE backend. In this mode:- No optimization passes will run.
- The last time custom passes are invoked is
CustomPassExecutionTime.BEFORE_OPTIMIZATIONS
- The compiler will always try to process all inputs fully, even if it encounters errors.
- The compiler may record more information than is strictly needed for codegen.
-
messageBundle
public transient MessageBundle messageBundle
Returns localized replacement for MSG_* variables
-
checkSymbols
public boolean checkSymbols
Checks that all symbols are defined
-
aggressiveVarCheck
public CheckLevel aggressiveVarCheck
-
checkSuspiciousCode
public boolean checkSuspiciousCode
Checks for suspicious statements that have no effect
-
checkControlStructures
public boolean checkControlStructures
Checks for invalid control structures
-
checkTypes
public boolean checkTypes
Checks types on expressions
-
reportMissingOverride
public CheckLevel reportMissingOverride
-
checkRequires
public CheckLevel checkRequires
Checks for missing goog.require() calls
-
checkProvides
public CheckLevel checkProvides
-
checkGlobalNamesLevel
public CheckLevel checkGlobalNamesLevel
-
brokenClosureRequiresLevel
public CheckLevel brokenClosureRequiresLevel
-
checkGlobalThisLevel
public CheckLevel checkGlobalThisLevel
-
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)
-
inlineFunctions
public boolean inlineFunctions
Inlines global functions
-
inlineLocalFunctions
public boolean inlineLocalFunctions
Inlines functions defined in local scopes
-
crossModuleCodeMotion
public boolean crossModuleCodeMotion
Move code to a deeper module
-
coalesceVariableNames
public boolean coalesceVariableNames
Merge two variables together as one.
-
crossModuleMethodMotion
public boolean crossModuleMethodMotion
Move methods to a deeper module
-
inlineGetters
public boolean inlineGetters
Inlines trivial getters
-
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
-
checkUnreachableCode
public CheckLevel checkUnreachableCode
-
checkMissingReturn
public CheckLevel checkMissingReturn
-
extractPrototypeMemberDeclarations
public boolean extractPrototypeMemberDeclarations
Extracts common prototype member declarations
-
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.
-
aliasExternals
public boolean aliasExternals
Adds variable aliases for externals to reduce code size
-
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.
-
optimizeParameters
public boolean optimizeParameters
Remove unused and constant parameters.
-
optimizeReturns
public boolean optimizeReturns
Remove unused return values.
-
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.
-
propertyRenaming
public PropertyRenamingPolicy propertyRenaming
Controls which properties 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.
-
aliasKeywords
public boolean aliasKeywords
Aliases true, false, and null to variables with shorter names.
-
collapseProperties
public boolean collapseProperties
Flattens multi-level property names (e.g. a$b = x)
-
devirtualizePrototypeMethods
public boolean devirtualizePrototypeMethods
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.
-
disambiguateProperties
public boolean disambiguateProperties
Rename properties to disambiguate between unrelated fields based on type information.
-
ambiguateProperties
public boolean ambiguateProperties
Rename unrelated properties to the same name to reduce code size.
-
anonymousFunctionNaming
public AnonymousFunctionNamingPolicy anonymousFunctionNaming
Give anonymous functions names for easier debugging
-
exportTestFunctions
public boolean exportTestFunctions
Whether to export test functions.
-
syntheticBlockStartMarker
public java.lang.String syntheticBlockStartMarker
-
syntheticBlockEndMarker
public java.lang.String syntheticBlockEndMarker
-
locale
public java.lang.String locale
Compiling locale
-
markAsCompiled
public boolean markAsCompiled
Sets the special "COMPILED" value to true
-
removeTryCatchFinally
public boolean removeTryCatchFinally
Removes try...catch...finally blocks for easier debugging
-
closurePass
public boolean closurePass
Processes goog.provide() and goog.require() calls
-
jqueryPass
public boolean jqueryPass
Processes jQuery aliases
-
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
public transient com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses
Custom passes
-
markNoSideEffectCalls
public boolean markNoSideEffectCalls
Mark no side effect calls
-
moveFunctionDeclarations
public boolean moveFunctionDeclarations
Move top-level function declarations to the top
-
instrumentationTemplate
public java.lang.String instrumentationTemplate
Instrumentation template to use with #recordFunctionInformation
-
recordFunctionInformation
public boolean recordFunctionInformation
Record function information
-
generateExports
public boolean generateExports
-
cssRenamingMap
public CssRenamingMap cssRenamingMap
Map used in the renaming of CSS class names.
-
prettyPrint
public boolean prettyPrint
Output in pretty indented format
-
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<SourceMap.LocationMapping> sourceMapLocationMappings
-
-
Method Detail
-
setAggressiveVarCheck
public void setAggressiveVarCheck(CheckLevel level)
Checks for suspicious variable definitions and undefined variables
-
setTightenTypes
public void setTightenTypes(boolean tighten)
Tightens types based on a global analysis. Experimental.
-
setReportMissingOverride
public void setReportMissingOverride(CheckLevel level)
Flags a warning if a property is missing the @override annotation, but it overrides a base class property.
-
setReportUnknownTypes
public void setReportUnknownTypes(CheckLevel level)
Flags a warning for every node whose type could not be determined.
-
setCheckRequires
public void setCheckRequires(CheckLevel level)
-
setCheckProvides
public void setCheckProvides(CheckLevel level)
Checks for missing goog.provides() calls
-
setCheckGlobalNamesLevel
public void setCheckGlobalNamesLevel(CheckLevel level)
Checks the integrity of references to qualified global names. (e.g. "a.b")
-
setBrokenClosureRequiresLevel
public void setBrokenClosureRequiresLevel(CheckLevel level)
Sets the check level for bad Closure require calls.
-
setCheckGlobalThisLevel
public void setCheckGlobalThisLevel(CheckLevel level)
Checks for certain uses of thethis
keyword that are considered unsafe because they are likely to reference the globalthis
object unintentionally. If this is off, but collapseProperties is on, then the compiler will usually ignore you and run this check anyways.
-
setCheckMissingGetCssNameLevel
public void setCheckMissingGetCssNameLevel(CheckLevel level)
Checks that certain string literals only appear in strings used as goog.getCssName arguments.
-
setCheckCaja
public void setCheckCaja(boolean check)
-
setCheckUnreachableCode
public void setCheckUnreachableCode(CheckLevel level)
Checks for unreachable code
-
setCheckMissingReturn
public void setCheckMissingReturn(CheckLevel level)
Checks for missing return statements
-
setAliasableGlobals
public void setAliasableGlobals(java.lang.String names)
A comma separated white-list of global names. WhenaliasExternals
is enable, if set to a non-empty string, only externals with these names will be considered for aliasing.
-
setUnaliasableGlobals
public void setUnaliasableGlobals(java.lang.String names)
A comma separated white-list of global names. WhenaliasExternals
is enable, these global names will not be aliased.
-
setCollapseObjectLiterals
public void setCollapseObjectLiterals(boolean enabled)
-
setSpecializeInitialModule
public void setSpecializeInitialModule(boolean enabled)
Specialize the initial module at the cost of later modules
-
setReplaceMessagesWithChromeI18n
public void setReplaceMessagesWithChromeI18n(boolean replaceMessagesWithChromeI18n, java.lang.String tcProjectId)
-
setIgnoreCajaProperties
public void setIgnoreCajaProperties(boolean enabled)
Add code to skip properties that Caja adds to Object.prototype
-
setAppNameStr
public void setAppNameStr(java.lang.String appNameStr)
App identifier string for use by the instrumentation template's app_name_setter. @see #instrumentationTemplate
-
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.
-
setReportPath
public void setReportPath(java.lang.String reportPath)
Where to save a report of global name usage
-
getTracerMode
public CompilerOptions.TracerMode getTracerMode()
-
setTracerMode
public void setTracerMode(CompilerOptions.TracerMode mode)
-
setNameReferenceReportPath
public void setNameReferenceReportPath(java.lang.String filePath)
Where to save a cross-reference report from the name reference graph
-
setNameReferenceGraphPath
public void setNameReferenceGraphPath(java.lang.String filePath)
Where to save the name reference graph
-
setProtectHiddenSideEffects
public void setProtectHiddenSideEffects(boolean enable)
When enabled, assume that apparently side-effect free code is meaningful.
-
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.
-
setPropertyAffinity
public void setPropertyAffinity(boolean useAffinity)
-
setShadowVariables
public void setShadowVariables(boolean shadow)
Should shadow outer scope variable name during renaming.
-
setCollapsePropertiesOnExternTypes
public void setCollapsePropertiesOnExternTypes(boolean collapse)
If true, flattens multi-level property names on extern types (e.g. String$f = x). This should only be used with the typed version of the externs files.
-
setProcessObjectPropertyString
public void setProcessObjectPropertyString(boolean process)
If true, process goog.testing.ObjectPropertyString instances.
-
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.
-
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.
-
setInlineFunctions
public void setInlineFunctions(CompilerOptions.Reach reach)
Set the function inlining policy for the compiler.
-
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.
-
setRemoveUnusedVariable
@Deprecated public void setRemoveUnusedVariable(CompilerOptions.Reach reach)
Deprecated.Set the variable removal policy for the compiler.
-
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.
-
setRewriteNewDateGoogNow
@Deprecated public void setRewriteNewDateGoogNow(boolean rewrite)
Deprecated.
-
setRemoveAbstractMethods
public void setRemoveAbstractMethods(boolean remove)
-
setRemoveClosureAsserts
public void setRemoveClosureAsserts(boolean remove)
-
setNameAnonymousFunctionsOnly
public void setNameAnonymousFunctionsOnly(boolean value)
If true, name anonymous functions only. All other passes will be skipped.
-
setColorizeErrorOutput
public void setColorizeErrorOutput(boolean colorizeErrorOutput)
-
shouldColorizeErrorOutput
public boolean shouldColorizeErrorOutput()
-
setChainCalls
public void setChainCalls(boolean value)
If true, chain calls to functions that return this.
-
setAcceptConstKeyword
public void setAcceptConstKeyword(boolean value)
If true, accept `const' keyword.
-
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()
-
setGenerateExports
public void setGenerateExports(boolean generateExports)
-
setAngularPass
public void setAngularPass(boolean angularPass)
-
setCodingConvention
public void setCodingConvention(CodingConvention codingConvention)
-
getCodingConvention
public CodingConvention getCodingConvention()
-
setDependencyOptions
public void setDependencyOptions(DependencyOptions options)
Sets dependency options. See the DependencyOptions class for more info. This supersedes manageClosureDependencies.
-
setManageClosureDependencies
public void setManageClosureDependencies(boolean newVal)
Sort inputs by their goog.provide/goog.require calls, and prune inputs whose symbols are not required.
-
setManageClosureDependencies
public void setManageClosureDependencies(java.util.List<java.lang.String> entryPoints)
Sort inputs by their goog.provide/goog.require calls.- Parameters:
entryPoints
- Entry points to the program. Must be goog.provide'd symbols. Any goog.provide'd symbols that are not a transitive dependency of the entry points will be deleted. Files without goog.provides, and their dependencies, will always be left in.
-
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
-
enableExternExports
@Deprecated public void enableExternExports(boolean enabled)
Deprecated.replaced bysetExternExports(boolean)
-
setExtraAnnotationNames
public void setExtraAnnotationNames(java.lang.Iterable<java.lang.String> extraAnnotationNames)
-
isExternExportsEnabled
public boolean isExternExportsEnabled()
-
setOutputCharset
public void setOutputCharset(java.lang.String charsetName)
Sets the output charset by name.
-
setTweakProcessing
public void setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
Sets how goog.tweak calls are processed.
-
getTweakProcessing
public CompilerOptions.TweakProcessing getTweakProcessing()
-
setLanguageIn
public void setLanguageIn(CompilerOptions.LanguageMode languageIn)
Sets how goog.tweak calls are processed.
-
getLanguageIn
public CompilerOptions.LanguageMode getLanguageIn()
-
getLanguageOut
public CompilerOptions.LanguageMode getLanguageOut()
-
setLooseTypes
public void setLooseTypes(boolean looseTypes)
Whether to include "undefined" in the default types. For example: "{Object}" is normally "Object|null" becomes "Object|null|undefined" "{?string}" is normally "string|null" becomes "string|null|undefined" In either case "!" annotated types excluded both null and undefined.
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
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.
-
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.
-
setLanguageOut
public void setLanguageOut(CompilerOptions.LanguageMode languageOut)
-
setIdeMode
public void setIdeMode(boolean ideMode)
-
setSaveDataStructures
public void setSaveDataStructures(boolean save)
Whether to keep internal data structures around after we're finished compiling. We do this by default when IDE mode is on.
-
setSkipAllPasses
public void setSkipAllPasses(boolean skipAllPasses)
-
setDevMode
public void setDevMode(com.google.javascript.jscomp.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)
-
setCheckControlStructures
public void setCheckControlStructures(boolean checkControlStructures)
-
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)
-
setInlineFunctions
public void setInlineFunctions(boolean inlineFunctions)
-
setInlineLocalFunctions
public void setInlineLocalFunctions(boolean inlineLocalFunctions)
-
setCrossModuleCodeMotion
public void setCrossModuleCodeMotion(boolean crossModuleCodeMotion)
-
setCoalesceVariableNames
public void setCoalesceVariableNames(boolean coalesceVariableNames)
-
setCrossModuleMethodMotion
public void setCrossModuleMethodMotion(boolean crossModuleMethodMotion)
-
setInlineGetters
public void setInlineGetters(boolean inlineGetters)
-
setInlineVariables
public void setInlineVariables(boolean inlineVariables)
-
setInlineLocalVariables
public void setInlineLocalVariables(boolean inlineLocalVariables)
-
setFlowSensitiveInlineVariables
public void setFlowSensitiveInlineVariables(boolean enabled)
-
setSmartNameRemoval
public void setSmartNameRemoval(boolean smartNameRemoval)
-
setRemoveDeadCode
public void setRemoveDeadCode(boolean removeDeadCode)
-
setExtractPrototypeMemberDeclarations
public void setExtractPrototypeMemberDeclarations(boolean enabled)
-
setRemoveUnusedPrototypeProperties
public void setRemoveUnusedPrototypeProperties(boolean enabled)
-
setRemoveUnusedPrototypePropertiesInExterns
public void setRemoveUnusedPrototypePropertiesInExterns(boolean enabled)
-
setRemoveUnusedVars
public void setRemoveUnusedVars(boolean removeUnusedVars)
-
setRemoveUnusedLocalVars
public void setRemoveUnusedLocalVars(boolean removeUnusedLocalVars)
-
setAliasExternals
public void setAliasExternals(boolean aliasExternals)
-
setCollapseVariableDeclarations
public void setCollapseVariableDeclarations(boolean enabled)
-
setGroupVariableDeclarations
public void setGroupVariableDeclarations(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)
-
setRewriteFunctionExpressions
public void setRewriteFunctionExpressions(boolean rewriteFunctionExpressions)
-
setOptimizeParameters
public void setOptimizeParameters(boolean optimizeParameters)
-
setOptimizeReturns
public void setOptimizeReturns(boolean optimizeReturns)
-
setOptimizeCalls
public void setOptimizeCalls(boolean optimizeCalls)
-
setOptimizeArgumentsArray
public void setOptimizeArgumentsArray(boolean optimizeArgumentsArray)
-
setVariableRenaming
public void setVariableRenaming(VariableRenamingPolicy variableRenaming)
-
setPropertyRenaming
public void setPropertyRenaming(PropertyRenamingPolicy propertyRenaming)
-
setLabelRenaming
public void setLabelRenaming(boolean labelRenaming)
-
setReserveRawExports
public void setReserveRawExports(boolean reserveRawExports)
-
setGeneratePseudoNames
public void setGeneratePseudoNames(boolean generatePseudoNames)
-
setRenamePrefix
public void setRenamePrefix(java.lang.String renamePrefix)
-
setRenamePrefixNamespace
public void setRenamePrefixNamespace(java.lang.String renamePrefixNamespace)
-
setAliasKeywords
public void setAliasKeywords(boolean aliasKeywords)
-
setCollapseProperties
public void setCollapseProperties(boolean collapseProperties)
-
setDevirtualizePrototypeMethods
public void setDevirtualizePrototypeMethods(boolean devirtualizePrototypeMethods)
-
setComputeFunctionSideEffects
public void setComputeFunctionSideEffects(boolean computeFunctionSideEffects)
-
setDebugFunctionSideEffectsPath
public void setDebugFunctionSideEffectsPath(java.lang.String debugFunctionSideEffectsPath)
-
setDisambiguateProperties
public void setDisambiguateProperties(boolean disambiguateProperties)
-
setAmbiguateProperties
public void setAmbiguateProperties(boolean ambiguateProperties)
-
setAnonymousFunctionNaming
public void setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming)
-
setInputAnonymousFunctionNamingMap
public void setInputAnonymousFunctionNamingMap(VariableMap inputMap)
-
setInputVariableMapSerialized
@Deprecated public void setInputVariableMapSerialized(byte[] inputVariableMapSerialized) throws java.text.ParseException
Deprecated.- Throws:
java.text.ParseException
-
setInputVariableMap
public void setInputVariableMap(VariableMap inputVariableMap)
-
setInputPropertyMapSerialized
@Deprecated public void setInputPropertyMapSerialized(byte[] inputPropertyMapSerialized) throws java.text.ParseException
Deprecated.- Throws:
java.text.ParseException
-
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)
-
setRemoveTryCatchFinally
public void setRemoveTryCatchFinally(boolean removeTryCatchFinally)
-
setClosurePass
public void setClosurePass(boolean closurePass)
-
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)
-
setCustomPasses
public void setCustomPasses(com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses)
-
setMarkNoSideEffectCalls
public void setMarkNoSideEffectCalls(boolean markNoSideEffectCalls)
-
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)
-
setInstrumentationTemplate
public void setInstrumentationTemplate(java.lang.String instrumentationTemplate)
-
setRecordFunctionInformation
public void setRecordFunctionInformation(boolean recordFunctionInformation)
-
setCssRenamingMap
public void setCssRenamingMap(CssRenamingMap cssRenamingMap)
-
setCssRenamingWhitelist
public void setCssRenamingWhitelist(java.util.Set<java.lang.String> whitelist)
-
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)
-
setLineBreak
public void setLineBreak(boolean lineBreak)
-
setPreferLineBreakAtEndOfFile
public void setPreferLineBreakAtEndOfFile(boolean lineBreakAtEnd)
-
setPrintInputDelimiter
public void setPrintInputDelimiter(boolean printInputDelimiter)
-
setInputDelimiter
public void setInputDelimiter(java.lang.String inputDelimiter)
-
setTracer
public void setTracer(CompilerOptions.TracerMode tracer)
-
setErrorFormat
public void setErrorFormat(ErrorFormat errorFormat)
-
setWarningsGuard
public void setWarningsGuard(ComposeWarningsGuard warningsGuard)
-
setLineLengthThreshold
public void setLineLengthThreshold(int lineLengthThreshold)
-
setExternExports
public void setExternExports(boolean externExports)
-
setExternExportsPath
public void setExternExportsPath(java.lang.String externExportsPath)
-
setSourceMapOutputPath
public void setSourceMapOutputPath(java.lang.String sourceMapOutputPath)
-
setSourceMapDetailLevel
public void setSourceMapDetailLevel(SourceMap.DetailLevel sourceMapDetailLevel)
-
setSourceMapFormat
public void setSourceMapFormat(SourceMap.Format sourceMapFormat)
-
setSourceMapLocationMappings
public void setSourceMapLocationMappings(java.util.List<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.
-
setCommonJSModulePathPrefix
public void setCommonJSModulePathPrefix(java.lang.String commonJSModulePathPrefix)
Sets a path prefix for CommonJS modules.
-
-