Class BaseTranspiler.CompilerSupplier
java.lang.Object
com.google.javascript.jscomp.transpile.BaseTranspiler.CompilerSupplier
- Enclosing class:
BaseTranspiler
Wraps the Compiler into a more relevant interface, making it easy to test the Transpiler
without depending on implementation details of the Compiler itself. Also works around the fact
that the Compiler is not thread-safe (since we may do multiple transpiles concurrently), so we
supply a fresh instance each time when we're in single-file mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ModuleLoader.ResolutionMode
protected final com.google.common.collect.ImmutableList
<String> protected final FeatureSet
-
Constructor Summary
ConstructorsConstructorDescriptionCompilerSupplier
(FeatureSet outputFeatureSet) CompilerSupplier
(FeatureSet outputFeatureSet, ModuleLoader.ResolutionMode moduleResolution, com.google.common.collect.ImmutableList<String> moduleRoots, com.google.common.collect.ImmutableMap<String, String> prefixReplacements) Accepts commonly overridden options for ES6 modules to avoid needed to subclass. -
Method Summary
Modifier and TypeMethodDescriptionprotected Compiler
compiler()
protected SourceFile
protected SourceFile
protected CompilerOptions
options()
protected void
setOptions
(CompilerOptions options)
-
Field Details
-
moduleResolution
-
moduleRoots
-
prefixReplacements
-
outputFeatureSet
-
-
Constructor Details
-
CompilerSupplier
public CompilerSupplier() -
CompilerSupplier
-
CompilerSupplier
public CompilerSupplier(FeatureSet outputFeatureSet, ModuleLoader.ResolutionMode moduleResolution, com.google.common.collect.ImmutableList<String> moduleRoots, com.google.common.collect.ImmutableMap<String, String> prefixReplacements) Accepts commonly overridden options for ES6 modules to avoid needed to subclass.- Parameters:
moduleResolution
- module resolution for resolving import pathsprefixReplacements
- prefix replacements for when moduleResolution isModuleLoader.ResolutionMode.BROWSER_WITH_TRANSFORMED_PREFIXES
-
-
Method Details
-
compile
-
runtime
-
compiler
-
options
-
setOptions
-
createTrivialExterns
-
createEmptySource
-