Package com.google.javascript.jscomp
Enum Class CompilationLevel
- All Implemented Interfaces:
Serializable
,Comparable<CompilationLevel>
,Constable
A CompilationLevel represents the level of optimization that should be
applied when compiling JavaScript code.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionADVANCED_OPTIMIZATIONS aggressively reduces code size by renaming function names and variables, removing code which is never called, etc.BUNDLE Simply orders and concatenates files to the output.SIMPLE_OPTIMIZATIONS performs transformations to the input JS that do not require any changes to JS that depend on the input JS.WHITESPACE_ONLY removes comments and extra whitespace in the input JS. -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable CompilationLevel
fromString
(String value) void
void
void
Enable additional optimizations that use type information.void
Enable additional optimizations that operate on global declarations.static CompilationLevel
Returns the enum constant of this class with the specified name.static CompilationLevel[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BUNDLE
BUNDLE Simply orders and concatenates files to the output. -
WHITESPACE_ONLY
WHITESPACE_ONLY removes comments and extra whitespace in the input JS. -
SIMPLE_OPTIMIZATIONS
SIMPLE_OPTIMIZATIONS performs transformations to the input JS that do not require any changes to JS that depend on the input JS. For example, function arguments are renamed (which should not matter to code that depends on the input JS), but functions themselves are not renamed (which would otherwise require external code to change to use the renamed function names). -
ADVANCED_OPTIMIZATIONS
ADVANCED_OPTIMIZATIONS aggressively reduces code size by renaming function names and variables, removing code which is never called, etc.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromString
-
setOptionsForCompilationLevel
-
setDebugOptionsForCompilationLevel
-
setTypeBasedOptimizationOptions
Enable additional optimizations that use type information. Only has an effect for ADVANCED_OPTIMIZATIONS; this is a no-op for other modes.- Parameters:
options
- The CompilerOptions object to set the options on.
-
setWrappedOutputOptimizations
Enable additional optimizations that operate on global declarations. Advanced mode does this by default, but this isn't valid in simple mode in the general case and should only be enabled when code is self contained (such as when it is enclosed by a function wrapper.- Parameters:
options
- The CompilerOptions object to set the options on.
-