Class DefaultPassConfig
- java.lang.Object
-
- com.google.javascript.jscomp.PassConfig
-
- com.google.javascript.jscomp.DefaultPassConfig
-
public final class DefaultPassConfig extends PassConfig
Pass factories and meta-data for native JSCompiler passes.NOTE(johnlenz): this needs some non-trivial refactoring. The pass config should use as little state as possible. The recommended way for a pass to leave behind some state for a subsequent pass is through the compiler object. Any other state remaining here should only be used when the pass config is creating the list of checks and optimizations, not after passes have started executing.
The general goal is for this class to be as minimal as possible. Option validation should occur before this class configures the compiler, business logic should live here (passes should not be inlined, etc).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.javascript.jscomp.PassConfig
PassConfig.PassConfigDelegate
-
-
Field Summary
-
Fields inherited from class com.google.javascript.jscomp.PassConfig
options
-
-
Constructor Summary
Constructors Constructor Description DefaultPassConfig(CompilerOptions options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<PassFactory>
getChecks()
Gets the checking passes to run.protected java.util.List<PassFactory>
getFinalizations()
Gets the finalization passes to run.protected java.util.List<PassFactory>
getOptimizations()
Gets the optimization passes to run.protected java.util.List<PassFactory>
getTranspileOnlyPasses()
Gets the transpilation passesprotected java.util.List<PassFactory>
getWhitespaceOnlyPasses()
Gets additional checking passes that are run always, even in "whitespace only" mode.
-
-
-
Constructor Detail
-
DefaultPassConfig
public DefaultPassConfig(CompilerOptions options)
-
-
Method Detail
-
getTranspileOnlyPasses
protected java.util.List<PassFactory> getTranspileOnlyPasses()
Description copied from class:PassConfig
Gets the transpilation passes- Overrides:
getTranspileOnlyPasses
in classPassConfig
-
getWhitespaceOnlyPasses
protected java.util.List<PassFactory> getWhitespaceOnlyPasses()
Description copied from class:PassConfig
Gets additional checking passes that are run always, even in "whitespace only" mode. For very specific cases where processing is required even in a mode which is intended not to have any processing - specifically introduced to support goog.module() usage.- Overrides:
getWhitespaceOnlyPasses
in classPassConfig
-
getChecks
protected java.util.List<PassFactory> getChecks()
Description copied from class:PassConfig
Gets the checking passes to run.Checking passes revolve around emitting warnings and errors. They also may include pre-processor passes needed to do error analysis more effectively.
Clients that only want to analyze code (like IDEs) and not emit code will only run checks and not optimizations.
- Specified by:
getChecks
in classPassConfig
-
getOptimizations
protected java.util.List<PassFactory> getOptimizations()
Description copied from class:PassConfig
Gets the optimization passes to run.Optimization passes revolve around producing smaller and faster code. They should always run after checking passes.
- Specified by:
getOptimizations
in classPassConfig
-
getFinalizations
protected java.util.List<PassFactory> getFinalizations()
Description copied from class:PassConfig
Gets the finalization passes to run.Finalization passes include the injection of locale-specific code and converting the AST to its final form for output.
- Specified by:
getFinalizations
in classPassConfig
-
-