public class CompilerOptions extends Object implements Serializable, Cloneable
Modifier and Type | Class and 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 checks
|
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 do
|
static class |
CompilerOptions.TweakProcessing
Option for the ProcessTweaks pass
|
Modifier and Type | Field and Description |
---|---|
CheckLevel |
aggressiveVarCheck |
Set<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 size
|
boolean |
aliasKeywords
Aliases true, false, and null to variables with shorter names.
|
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 debugging
|
CheckLevel |
brokenClosureRequiresLevel |
boolean |
checkControlStructures
Deprecated.
|
CheckLevel |
checkGlobalNamesLevel |
CheckLevel |
checkGlobalThisLevel |
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() calls
|
boolean |
checkSuspiciousCode
Checks for suspicious statements that have no effect
|
boolean |
checkSymbols
Checks that all symbols are defined
|
boolean |
checkTypes
Checks types on expressions
|
boolean |
closurePass
Processes goog.provide() and goog.require() calls
|
boolean |
coalesceVariableNames
Merge two variables together as one.
|
boolean |
collapseAnonymousFunctions
Collapses anonymous function declarations into named function
declarations
|
boolean |
collapseProperties
Flattens multi-level property names (e.g.
|
boolean |
collapseVariableDeclarations
Collapses multiple variable declarations into one
|
boolean |
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 module
|
boolean |
crossModuleMethodMotion
Move methods to a deeper module
|
CssRenamingMap |
cssRenamingMap
Map used in the renaming of CSS class names.
|
com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> |
customPasses
Custom passes
|
boolean |
deadAssignmentElimination
Remove assignments to values that can not be referenced
|
boolean |
devirtualizePrototypeMethods
Devirtualize prototype method by rewriting them to be static calls that
take the this pointer as their first argument
|
boolean |
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 declarations
|
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 |
ideMode
Configures the compiler for use as an IDE backend.
|
boolean |
inlineConstantVars
Inlines constants (symbols that are all CAPS)
|
boolean |
inlineFunctions
Inlines global functions
|
boolean |
inlineGetters
Inlines trivial getters
|
boolean |
inlineLocalFunctions
Inlines functions defined in local scopes
|
boolean |
inlineVariables
Inlines variables
|
String |
inputDelimiter
The string to use as the separator for printInputDelimiter
|
String |
instrumentationTemplate
Instrumentation template to use with #recordFunctionInformation
|
boolean |
instrumentForCoverage
Instrument code for the purpose of collecting coverage data.
|
boolean |
jqueryPass
Processes jQuery aliases
|
boolean |
labelRenaming
Controls label renaming.
|
boolean |
lineBreak
Line break the output a bit more aggressively
|
String |
locale
Compiling locale
|
boolean |
markAsCompiled
Sets the special "COMPILED" value to true
|
boolean |
markNoSideEffectCalls
Mark no side effect calls
|
MessageBundle |
messageBundle
Returns localized replacement for MSG_* variables
|
boolean |
moveFunctionDeclarations
Move top-level function declarations to the top
|
boolean |
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 file
|
boolean |
preserveGoogRequires
Do not strip goog.require() calls from the code.
|
boolean |
prettyPrint
Output in pretty indented format
|
boolean |
printInputDelimiter
Prints a separator comment before each JS script
|
PropertyRenamingPolicy |
propertyRenaming
Controls which properties get renamed.
|
boolean |
recordFunctionInformation
Record function information
|
boolean |
removeDeadCode
Removes code that will never execute
|
boolean |
removeUnusedClassProperties
Removes unused member properties
|
boolean |
removeUnusedLocalVars
Removes unused variables in local scope.
|
boolean |
removeUnusedPrototypeProperties
Removes unused member prototypes
|
boolean |
removeUnusedPrototypePropertiesInExterns
Tells AnalyzePrototypeProperties it can remove externed props.
|
boolean |
removeUnusedVars
Removes unused variables
|
String |
renamePrefix
Specifies a prefix for all globals
|
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 names
|
SourceMap.DetailLevel |
sourceMapDetailLevel
The detail level for the generated source map.
|
SourceMap.Format |
sourceMapFormat
The source map file format
|
List<SourceMap.LocationMapping> |
sourceMapLocationMappings |
String |
sourceMapOutputPath
The output path for the source map.
|
Set<String> |
stripNamePrefixes
Name prefixes that determine which variables and properties to strip
|
Set<String> |
stripNameSuffixes
Name suffixes that determine which variables and properties to strip
|
Set<String> |
stripTypePrefixes
Qualified type name prefixes that determine which types to strip
|
Set<String> |
stripTypes
Names of types to strip
|
String |
syntheticBlockEndMarker |
String |
syntheticBlockStartMarker |
static RenamingMap |
UNIQUE_ID_GENERATOR
A renaming map instance to use to signal the use of the "inconsistent"
id generator type.
|
VariableRenamingPolicy |
variableRenaming
Controls which variables get renamed.
|
Constructor and Description |
---|
CompilerOptions()
Initializes compiler options.
|
Modifier and Type | Method and Description |
---|---|
void |
addWarningsGuard(WarningsGuard guard)
Add a guard to the set of warnings guards.
|
boolean |
assumeClosuresOnlyCaptureReferences() |
boolean |
assumeStrictThis() |
Object |
clone() |
void |
disableRuntimeTypeCheck() |
void |
enableExternExports(boolean enabled)
Deprecated.
replaced by
setExternExports(boolean) |
void |
enableRuntimeTypeCheck(String logFunction)
Enable run-time type checking, which adds JS type assertions for debugging.
|
CompilerOptions.AliasTransformationHandler |
getAliasTransformationHandler() |
boolean |
getCheckDeterminism() |
CheckEventfulObjectDisposal.DisposalCheckingPolicy |
getCheckEventfulObjectDisposalPolicy() |
CodingConvention |
getCodingConvention() |
Map<String,Node> |
getDefineReplacements()
Returns the map of define replacements.
|
boolean |
getInferTypes()
Gets the inferTypes flag.
|
boolean |
getInstrumentMemoryAllocations() |
CompilerOptions.LanguageMode |
getLanguageIn() |
CompilerOptions.LanguageMode |
getLanguageOut() |
boolean |
getNewTypeInference() |
CompilerOptions.TracerMode |
getTracerMode() |
CompilerOptions.TweakProcessing |
getTweakProcessing() |
Map<String,Node> |
getTweakReplacements()
Returns the map of tweak replacements.
|
boolean |
isDisambiguatePrivateProperties() |
boolean |
isExternExportsEnabled() |
boolean |
isRemoveUnusedClassProperties() |
void |
resetWarningsGuard()
Reset the warnings guard.
|
void |
setAcceptConstKeyword(boolean value)
If true, accept `const' keyword.
|
void |
setAggressiveRenaming(boolean aggressive) |
void |
setAggressiveVarCheck(CheckLevel level)
Checks for suspicious variable definitions and undefined variables
|
void |
setAliasableGlobals(String names)
A comma separated white-list of global names.
|
void |
setAliasableStrings(Set<String> aliasableStrings) |
void |
setAliasAllStrings(boolean aliasAllStrings) |
void |
setAliasExternals(boolean aliasExternals) |
void |
setAliasKeywords(boolean aliasKeywords) |
void |
setAliasStringsBlacklist(String aliasStringsBlacklist) |
void |
setAliasTransformationHandler(CompilerOptions.AliasTransformationHandler changes) |
void |
setAmbiguateProperties(boolean ambiguateProperties) |
void |
setAngularPass(boolean angularPass) |
void |
setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming) |
void |
setAppNameStr(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 |
setCheckControlStructures(boolean checkControlStructures)
Deprecated.
|
void |
setCheckDeterminism(boolean checkDeterminism) |
void |
setCheckEventfulObjectDisposalPolicy(CheckEventfulObjectDisposal.DisposalCheckingPolicy policy) |
void |
setCheckGlobalNamesLevel(CheckLevel level)
Checks the integrity of references to qualified global names.
|
void |
setCheckGlobalThisLevel(CheckLevel level)
Checks for certain uses of the
this keyword that are considered
unsafe because they are likely to reference the global this
object unintentionally. |
void |
setCheckMissingGetCssNameBlacklist(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 statements
|
void |
setCheckProvides(CheckLevel level)
Checks for missing goog.provides() calls
|
void |
setCheckRequires(CheckLevel level) |
void |
setCheckSuspiciousCode(boolean checkSuspiciousCode) |
void |
setCheckSymbols(boolean checkSymbols) |
void |
setCheckTypes(boolean checkTypes) |
void |
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(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(Set<String> whitelist) |
void |
setCustomPasses(com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses) |
void |
setDeadAssignmentElimination(boolean deadAssignmentElimination) |
void |
setDebugFunctionSideEffectsPath(String debugFunctionSideEffectsPath) |
void |
setDefineReplacements(Map<String,Object> defineReplacements) |
void |
setDefineToBooleanLiteral(String defineName,
boolean value)
Sets the value of the
@define variable in JS
to a boolean literal. |
void |
setDefineToDoubleLiteral(String defineName,
double value)
Sets the value of the
@define variable in JS to a
number literal. |
void |
setDefineToNumberLiteral(String defineName,
int value)
Sets the value of the
@define variable in JS to a
number literal. |
void |
setDefineToStringLiteral(String defineName,
String value)
Sets the value of the
@define variable in JS to a
String literal. |
void |
setDependencyOptions(DependencyOptions options)
Sets dependency options.
|
void |
setDevirtualizePrototypeMethods(boolean devirtualizePrototypeMethods) |
void |
setDevMode(com.google.javascript.jscomp.CompilerOptions.DevMode devMode) |
void |
setDisambiguatePrivateProperties(boolean value) |
void |
setDisambiguateProperties(boolean disambiguateProperties) |
void |
setErrorFormat(ErrorFormat errorFormat) |
void |
setErrorHandler(ErrorHandler handler)
Set a custom handler for warnings and errors.
|
void |
setExportLocalPropertyDefinitions(boolean export) |
void |
setExportTestFunctions(boolean exportTestFunctions) |
void |
setExternExports(boolean externExports) |
void |
setExternExportsPath(String externExportsPath) |
void |
setExtraAnnotationNames(Iterable<String> extraAnnotationNames) |
void |
setExtractPrototypeMemberDeclarations(boolean enabled) |
void |
setExtraSmartNameRemoval(boolean smartNameRemoval) |
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(Map<String,RenamingMap> idGenerators)
Sets the id generators to replace.
|
void |
setIdGenerators(Set<String> idGenerators)
Sets the id generators to replace.
|
void |
setIdGeneratorsMap(String previousMappings)
A previous map of ids (serialized to a string by a previous compile).
|
void |
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(String inputDelimiter) |
void |
setInputPropertyMap(VariableMap inputPropertyMap) |
void |
setInputVariableMap(VariableMap inputVariableMap) |
void |
setInstrumentationTemplate(String instrumentationTemplate) |
void |
setInstrumentForCoverage(boolean instrumentForCoverage)
Set whether or not code should be modified to provide coverage
information.
|
void |
setInstrumentMemoryAllocations(boolean instrumentMemoryAllocations)
Sets the option to instrument memory allocations.
|
void |
setLabelRenaming(boolean labelRenaming) |
void |
setLanguageIn(CompilerOptions.LanguageMode languageIn)
Sets ECMAScript version to use.
|
void |
setLanguageOut(CompilerOptions.LanguageMode languageOut) |
void |
setLineBreak(boolean lineBreak) |
void |
setLineLengthThreshold(int lineLengthThreshold) |
void |
setLocale(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(List<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(String filePath)
Where to save the name reference graph
|
void |
setNameReferenceReportPath(String filePath)
Where to save a cross-reference report from the name reference graph
|
void |
setNewTypeInference(boolean enable) |
void |
setOptimizeArgumentsArray(boolean optimizeArgumentsArray) |
void |
setOptimizeCalls(boolean optimizeCalls) |
void |
setOptimizeParameters(boolean optimizeParameters) |
void |
setOptimizeReturns(boolean optimizeReturns) |
void |
setOutputCharset(String charsetName)
Sets the output charset by name.
|
void |
setOutputJsStringUsage(boolean outputJsStringUsage) |
void |
setParentModuleCanSeeSymbolsDeclaredInChildren(boolean parentModuleCanSeeSymbolsDeclaredInChildren) |
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 |
setPreserveGoogRequires(boolean preserveGoogRequires) |
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(Map<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 |
setRemoveUnusedClassProperties(boolean removeUnusedClassProperties) |
void |
setRemoveUnusedLocalVars(boolean removeUnusedLocalVars) |
void |
setRemoveUnusedPrototypeProperties(boolean enabled) |
void |
setRemoveUnusedPrototypePropertiesInExterns(boolean enabled) |
void |
setRemoveUnusedVariables(CompilerOptions.Reach reach)
Set the variable removal policy for the compiler.
|
void |
setRemoveUnusedVars(boolean removeUnusedVars) |
void |
setRenamePrefix(String renamePrefix) |
void |
setRenamePrefixNamespace(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,
String tcProjectId) |
void |
setReplaceStringsConfiguration(String placeholderToken,
List<String> functionDescriptors)
Sets the functions whose debug strings to replace.
|
void |
setReplaceStringsFunctionDescriptions(List<String> replaceStringsFunctionDescriptions) |
void |
setReplaceStringsInputMap(VariableMap serializedMap) |
void |
setReplaceStringsPlaceholderToken(String replaceStringsPlaceholderToken) |
void |
setReplaceStringsReservedStrings(Set<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(String reportPath)
Where to save a report of global name usage
|
void |
setReserveRawExports(boolean reserveRawExports) |
void |
setRewriteFunctionExpressions(boolean rewriteFunctionExpressions) |
void |
setRuntimeTypeCheck(boolean runtimeTypeCheck) |
void |
setRuntimeTypeCheckLogFunction(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(List<SourceMap.LocationMapping> sourceMapLocationMappings) |
void |
setSourceMapOutputPath(String sourceMapOutputPath) |
void |
setSpecializeInitialModule(boolean enabled)
Specialize the initial module at the cost of later modules
|
void |
setStripNamePrefixes(Set<String> stripNamePrefixes) |
void |
setStripNameSuffixes(Set<String> stripNameSuffixes) |
void |
setStripTypePrefixes(Set<String> stripTypePrefixes) |
void |
setStripTypes(Set<String> stripTypes) |
void |
setSummaryDetailLevel(int summaryDetailLevel)
Controls how detailed the compilation summary is.
|
void |
setSyntheticBlockEndMarker(String syntheticBlockEndMarker) |
void |
setSyntheticBlockStartMarker(String syntheticBlockStartMarker) |
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(Map<String,Object> tweakReplacements) |
void |
setTweakToBooleanLiteral(String tweakId,
boolean value)
Sets the value of the tweak in JS
to a boolean literal.
|
void |
setTweakToDoubleLiteral(String tweakId,
double value)
Sets the value of the tweak in JS to a
number literal.
|
void |
setTweakToNumberLiteral(String tweakId,
int value)
Sets the value of the tweak in JS to a
number literal.
|
void |
setTweakToStringLiteral(String tweakId,
String value)
Sets the value of the tweak in JS to a
String literal.
|
void |
setUnaliasableGlobals(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.
|
public boolean ideMode
CustomPassExecutionTime.BEFORE_OPTIMIZATIONS
public transient MessageBundle messageBundle
public boolean checkSymbols
public CheckLevel aggressiveVarCheck
public boolean checkSuspiciousCode
@Deprecated public boolean checkControlStructures
public boolean checkTypes
public CheckLevel reportMissingOverride
public CheckLevel checkRequires
public CheckLevel checkProvides
public CheckLevel checkGlobalNamesLevel
public CheckLevel brokenClosureRequiresLevel
public CheckLevel checkGlobalThisLevel
public CheckLevel checkMissingGetCssNameLevel
public String checkMissingGetCssNameBlacklist
public boolean foldConstants
public boolean deadAssignmentElimination
public boolean inlineConstantVars
public boolean inlineFunctions
public boolean inlineLocalFunctions
public boolean crossModuleCodeMotion
public boolean coalesceVariableNames
public boolean crossModuleMethodMotion
public boolean inlineGetters
public boolean inlineVariables
public boolean flowSensitiveInlineVariables
public boolean smartNameRemoval
public boolean removeDeadCode
public CheckLevel checkMissingReturn
public boolean extractPrototypeMemberDeclarations
public boolean removeUnusedPrototypeProperties
public boolean removeUnusedPrototypePropertiesInExterns
public boolean removeUnusedClassProperties
public boolean removeUnusedVars
public boolean removeUnusedLocalVars
public boolean aliasExternals
public boolean collapseVariableDeclarations
public boolean collapseAnonymousFunctions
public Set<String> aliasableStrings
public String aliasStringsBlacklist
public boolean aliasAllStrings
public boolean convertToDottedProperties
public boolean rewriteFunctionExpressions
public boolean optimizeParameters
public boolean optimizeReturns
public boolean optimizeCalls
public boolean optimizeArgumentsArray
public VariableRenamingPolicy variableRenaming
public PropertyRenamingPolicy propertyRenaming
public boolean labelRenaming
public boolean reserveRawExports
public boolean generatePseudoNames
public String renamePrefix
public String renamePrefixNamespace
public boolean aliasKeywords
public boolean collapseProperties
public boolean devirtualizePrototypeMethods
public boolean computeFunctionSideEffects
public boolean disambiguateProperties
public boolean ambiguateProperties
public AnonymousFunctionNamingPolicy anonymousFunctionNaming
public boolean exportTestFunctions
public String syntheticBlockStartMarker
public String syntheticBlockEndMarker
public String locale
public boolean markAsCompiled
public boolean closurePass
public boolean preserveGoogRequires
public boolean jqueryPass
public boolean gatherCssNames
public Set<String> stripNameSuffixes
public Set<String> stripNamePrefixes
public Set<String> stripTypePrefixes
public transient com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses
public boolean markNoSideEffectCalls
public boolean moveFunctionDeclarations
public String instrumentationTemplate
public boolean recordFunctionInformation
public boolean generateExports
public CssRenamingMap cssRenamingMap
public boolean prettyPrint
public boolean lineBreak
public boolean preferLineBreakAtEndOfFile
public boolean printInputDelimiter
public String inputDelimiter
public ErrorFormat errorFormat
public String sourceMapOutputPath
public SourceMap.DetailLevel sourceMapDetailLevel
public SourceMap.Format sourceMapFormat
public List<SourceMap.LocationMapping> sourceMapLocationMappings
public boolean instrumentForCoverage
public static final RenamingMap UNIQUE_ID_GENERATOR
public CompilerOptions()
public void setAggressiveVarCheck(CheckLevel level)
public void setReportMissingOverride(CheckLevel level)
public void setCheckRequires(CheckLevel level)
public void setCheckProvides(CheckLevel level)
public void setCheckGlobalNamesLevel(CheckLevel level)
public void setBrokenClosureRequiresLevel(CheckLevel level)
public void setCheckGlobalThisLevel(CheckLevel level)
this
keyword that are considered
unsafe because they are likely to reference the global this
object unintentionally.
If this is off, but collapseProperties is on, then the compiler will
usually ignore you and run this check anyways.public void setCheckMissingGetCssNameLevel(CheckLevel level)
public void setCheckEventfulObjectDisposalPolicy(CheckEventfulObjectDisposal.DisposalCheckingPolicy policy)
public CheckEventfulObjectDisposal.DisposalCheckingPolicy getCheckEventfulObjectDisposalPolicy()
public void setCheckMissingReturn(CheckLevel level)
public void setAliasableGlobals(String names)
aliasExternals
is enable, if set to a non-empty string, only externals with these names
will be considered for aliasing.public void setUnaliasableGlobals(String names)
aliasExternals
is enable, these global names will not be aliased.public void setCollapseObjectLiterals(boolean enabled)
public void setSpecializeInitialModule(boolean enabled)
public void setReplaceMessagesWithChromeI18n(boolean replaceMessagesWithChromeI18n, String tcProjectId)
public void setAppNameStr(String appNameStr)
public void setPreferSingleQuotes(boolean enabled)
public void setTrustedStrings(boolean yes)
public void setReportPath(String reportPath)
public CompilerOptions.TracerMode getTracerMode()
public void setTracerMode(CompilerOptions.TracerMode mode)
public void setNameReferenceReportPath(String filePath)
public void setNameReferenceGraphPath(String filePath)
public void setProtectHiddenSideEffects(boolean enable)
public boolean isRemoveUnusedClassProperties()
public void setRemoveUnusedClassProperties(boolean removeUnusedClassProperties)
removeUnusedClassProperties
- Whether to attempt to remove
unused class propertiespublic Map<String,Node> getDefineReplacements()
public Map<String,Node> getTweakReplacements()
public void setDefineToBooleanLiteral(String defineName, boolean value)
@define
variable in JS
to a boolean literal.public void setDefineToStringLiteral(String defineName, String value)
@define
variable in JS to a
String literal.public void setDefineToNumberLiteral(String defineName, int value)
@define
variable in JS to a
number literal.public void setDefineToDoubleLiteral(String defineName, double value)
@define
variable in JS to a
number literal.public void setTweakToBooleanLiteral(String tweakId, boolean value)
public void setTweakToStringLiteral(String tweakId, String value)
public void setTweakToNumberLiteral(String tweakId, int value)
public void setTweakToDoubleLiteral(String tweakId, double value)
public void skipAllCompilerPasses()
public void setWarningLevel(DiagnosticGroup type, CheckLevel level)
public void resetWarningsGuard()
public void addWarningsGuard(WarningsGuard guard)
public void setRenamingPolicy(VariableRenamingPolicy newVariablePolicy, PropertyRenamingPolicy newPropertyPolicy)
public void setPropertyAffinity(boolean useAffinity)
public void setShadowVariables(boolean shadow)
public void setCollapsePropertiesOnExternTypes(boolean collapse)
public void setProcessObjectPropertyString(boolean process)
public void setReplaceIdGenerators(boolean replaceIdGenerators)
replaceIdGenerators
- the replaceIdGenerators to setpublic void setIdGenerators(Set<String> idGenerators)
public void setIdGenerators(Map<String,RenamingMap> idGenerators)
public void setIdGeneratorsMap(String previousMappings)
public void setInlineFunctions(CompilerOptions.Reach reach)
public void setInlineVariables(CompilerOptions.Reach reach)
public void setInlineProperties(boolean enable)
public void setRemoveUnusedVariables(CompilerOptions.Reach reach)
public void setReplaceStringsConfiguration(String placeholderToken, List<String> functionDescriptors)
public void setRemoveAbstractMethods(boolean remove)
public void setRemoveClosureAsserts(boolean remove)
public void setNameAnonymousFunctionsOnly(boolean value)
public void setColorizeErrorOutput(boolean colorizeErrorOutput)
public boolean shouldColorizeErrorOutput()
public void setChainCalls(boolean value)
public void setAcceptConstKeyword(boolean value)
public void enableRuntimeTypeCheck(String logFunction)
logFunction
- A JS function to be used for logging run-time type
assertion failures.public void disableRuntimeTypeCheck()
public void setGenerateExports(boolean generateExports)
public void setExportLocalPropertyDefinitions(boolean export)
public void setAngularPass(boolean angularPass)
public void setCodingConvention(CodingConvention codingConvention)
public CodingConvention getCodingConvention()
public void setDependencyOptions(DependencyOptions options)
public void setManageClosureDependencies(boolean newVal)
public void setManageClosureDependencies(List<String> entryPoints)
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.public void setSummaryDetailLevel(int summaryDetailLevel)
@Deprecated public void enableExternExports(boolean enabled)
setExternExports(boolean)
public boolean isExternExportsEnabled()
public void setOutputCharset(String charsetName)
public void setTweakProcessing(CompilerOptions.TweakProcessing tweakProcessing)
public CompilerOptions.TweakProcessing getTweakProcessing()
public void setLanguageIn(CompilerOptions.LanguageMode languageIn)
public CompilerOptions.LanguageMode getLanguageIn()
public CompilerOptions.LanguageMode getLanguageOut()
public void setLooseTypes(boolean looseTypes)
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void setAliasTransformationHandler(CompilerOptions.AliasTransformationHandler changes)
public CompilerOptions.AliasTransformationHandler getAliasTransformationHandler()
public void setErrorHandler(ErrorHandler handler)
public void setInferTypes(boolean enable)
public boolean getInferTypes()
public boolean getNewTypeInference()
public void setNewTypeInference(boolean enable)
public boolean assumeStrictThis()
public void setAssumeStrictThis(boolean enable)
public boolean assumeClosuresOnlyCaptureReferences()
public void setAssumeClosuresOnlyCaptureReferences(boolean enable)
public void setPropertyInvalidationErrors(Map<String,CheckLevel> propertyInvalidationErrors)
public void setLanguageOut(CompilerOptions.LanguageMode languageOut)
public void setIdeMode(boolean ideMode)
public void setSaveDataStructures(boolean save)
public void setSkipAllPasses(boolean skipAllPasses)
public void setDevMode(com.google.javascript.jscomp.CompilerOptions.DevMode devMode)
public void setCheckDeterminism(boolean checkDeterminism)
public boolean getCheckDeterminism()
public void setMessageBundle(MessageBundle messageBundle)
public void setCheckSymbols(boolean checkSymbols)
public void setCheckSuspiciousCode(boolean checkSuspiciousCode)
@Deprecated public void setCheckControlStructures(boolean checkControlStructures)
public void setCheckTypes(boolean checkTypes)
public void setCheckMissingGetCssNameBlacklist(String blackList)
public void setAggressiveRenaming(boolean aggressive)
public void setFoldConstants(boolean foldConstants)
public void setDeadAssignmentElimination(boolean deadAssignmentElimination)
public void setInlineConstantVars(boolean inlineConstantVars)
public void setInlineFunctions(boolean inlineFunctions)
public void setInlineLocalFunctions(boolean inlineLocalFunctions)
public void setCrossModuleCodeMotion(boolean crossModuleCodeMotion)
public void setParentModuleCanSeeSymbolsDeclaredInChildren(boolean parentModuleCanSeeSymbolsDeclaredInChildren)
public void setCoalesceVariableNames(boolean coalesceVariableNames)
public void setCrossModuleMethodMotion(boolean crossModuleMethodMotion)
public void setInlineGetters(boolean inlineGetters)
public void setInlineVariables(boolean inlineVariables)
public void setInlineLocalVariables(boolean inlineLocalVariables)
public void setFlowSensitiveInlineVariables(boolean enabled)
public void setSmartNameRemoval(boolean smartNameRemoval)
public void setExtraSmartNameRemoval(boolean smartNameRemoval)
public void setRemoveDeadCode(boolean removeDeadCode)
public void setExtractPrototypeMemberDeclarations(boolean enabled)
public void setRemoveUnusedPrototypeProperties(boolean enabled)
public void setRemoveUnusedPrototypePropertiesInExterns(boolean enabled)
public void setRemoveUnusedVars(boolean removeUnusedVars)
public void setRemoveUnusedLocalVars(boolean removeUnusedLocalVars)
public void setAliasExternals(boolean aliasExternals)
public void setCollapseVariableDeclarations(boolean enabled)
public void setGroupVariableDeclarations(boolean enabled)
public void setCollapseAnonymousFunctions(boolean enabled)
public void setAliasStringsBlacklist(String aliasStringsBlacklist)
public void setAliasAllStrings(boolean aliasAllStrings)
public void setOutputJsStringUsage(boolean outputJsStringUsage)
public void setConvertToDottedProperties(boolean convertToDottedProperties)
public void setRewriteFunctionExpressions(boolean rewriteFunctionExpressions)
public void setOptimizeParameters(boolean optimizeParameters)
public void setOptimizeReturns(boolean optimizeReturns)
public void setOptimizeCalls(boolean optimizeCalls)
public void setOptimizeArgumentsArray(boolean optimizeArgumentsArray)
public void setVariableRenaming(VariableRenamingPolicy variableRenaming)
public void setPropertyRenaming(PropertyRenamingPolicy propertyRenaming)
public void setLabelRenaming(boolean labelRenaming)
public void setReserveRawExports(boolean reserveRawExports)
public void setPreferStableNames(boolean preferStableNames)
public void setGeneratePseudoNames(boolean generatePseudoNames)
public void setRenamePrefix(String renamePrefix)
public void setRenamePrefixNamespace(String renamePrefixNamespace)
public void setAliasKeywords(boolean aliasKeywords)
public void setCollapseProperties(boolean collapseProperties)
public void setDevirtualizePrototypeMethods(boolean devirtualizePrototypeMethods)
public void setComputeFunctionSideEffects(boolean computeFunctionSideEffects)
public void setDebugFunctionSideEffectsPath(String debugFunctionSideEffectsPath)
public boolean isDisambiguatePrivateProperties()
public void setDisambiguatePrivateProperties(boolean value)
value
- Whether to enable private property disambiguation based on
the coding convention.public void setDisambiguateProperties(boolean disambiguateProperties)
public void setAmbiguateProperties(boolean ambiguateProperties)
public void setAnonymousFunctionNaming(AnonymousFunctionNamingPolicy anonymousFunctionNaming)
public void setInputAnonymousFunctionNamingMap(VariableMap inputMap)
public void setInputVariableMap(VariableMap inputVariableMap)
public void setInputPropertyMap(VariableMap inputPropertyMap)
public void setExportTestFunctions(boolean exportTestFunctions)
public void setRuntimeTypeCheck(boolean runtimeTypeCheck)
public void setRuntimeTypeCheckLogFunction(String runtimeTypeCheckLogFunction)
public void setSyntheticBlockStartMarker(String syntheticBlockStartMarker)
public void setSyntheticBlockEndMarker(String syntheticBlockEndMarker)
public void setLocale(String locale)
public void setMarkAsCompiled(boolean markAsCompiled)
public void setClosurePass(boolean closurePass)
public void setPreserveGoogRequires(boolean preserveGoogRequires)
public void setGatherCssNames(boolean gatherCssNames)
public void setCustomPasses(com.google.common.collect.Multimap<CustomPassExecutionTime,CompilerPass> customPasses)
public void setMarkNoSideEffectCalls(boolean markNoSideEffectCalls)
public void setMoveFunctionDeclarations(boolean moveFunctionDeclarations)
public void setInstrumentationTemplate(String instrumentationTemplate)
public void setRecordFunctionInformation(boolean recordFunctionInformation)
public void setCssRenamingMap(CssRenamingMap cssRenamingMap)
public void setReplaceStringsFunctionDescriptions(List<String> replaceStringsFunctionDescriptions)
public void setReplaceStringsPlaceholderToken(String replaceStringsPlaceholderToken)
public void setReplaceStringsReservedStrings(Set<String> replaceStringsReservedStrings)
public void setReplaceStringsInputMap(VariableMap serializedMap)
public void setPrettyPrint(boolean prettyPrint)
public void setLineBreak(boolean lineBreak)
public void setPreferLineBreakAtEndOfFile(boolean lineBreakAtEnd)
public void setPrintInputDelimiter(boolean printInputDelimiter)
public void setInputDelimiter(String inputDelimiter)
public void setErrorFormat(ErrorFormat errorFormat)
public void setWarningsGuard(ComposeWarningsGuard warningsGuard)
public void setLineLengthThreshold(int lineLengthThreshold)
public void setExternExports(boolean externExports)
public void setExternExportsPath(String externExportsPath)
public void setSourceMapOutputPath(String sourceMapOutputPath)
public void setSourceMapDetailLevel(SourceMap.DetailLevel sourceMapDetailLevel)
public void setSourceMapFormat(SourceMap.Format sourceMapFormat)
public void setSourceMapLocationMappings(List<SourceMap.LocationMapping> sourceMapLocationMappings)
public void setTransformAMDToCJSModules(boolean transformAMDToCJSModules)
public void setProcessCommonJSModules(boolean processCommonJSModules)
public void setCommonJSModulePathPrefix(String commonJSModulePathPrefix)
public boolean getInstrumentMemoryAllocations()
public void setInstrumentMemoryAllocations(boolean instrumentMemoryAllocations)
public void setInstrumentForCoverage(boolean instrumentForCoverage)
Copyright © 2009-2014 Google. All Rights Reserved.