Class CompilerBasedTransformer.CompilerSupplier
- java.lang.Object
-
- com.google.javascript.jscomp.bundle.CompilerBasedTransformer.CompilerSupplier
-
- Direct Known Subclasses:
CoverageInstrumenter.CompilerSupplier
- Enclosing class:
- CompilerBasedTransformer
@Immutable public static class CompilerBasedTransformer.CompilerSupplier extends java.lang.Object
Wraps the Compiler into a more relevant interface, making it easy to test the CompilerBasedTransformer 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
Fields Modifier and Type Field Description protected static SourceFile
EMPTY
protected static DiagnosticGroup
ES5_WARNINGS
protected static SourceFile
EXTERNS
-
Constructor Summary
Constructors Constructor Description CompilerSupplier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompilerBasedTransformer.CompileResult
compile(java.nio.file.Path path, java.lang.String code)
protected Compiler
compiler()
protected CompilerOptions
options()
java.lang.String
runtime(java.lang.String library)
protected void
setOptions(CompilerOptions options)
boolean
transformed(Result result)
-
-
-
Field Detail
-
EXTERNS
protected static final SourceFile EXTERNS
-
EMPTY
protected static final SourceFile EMPTY
-
ES5_WARNINGS
protected static final DiagnosticGroup ES5_WARNINGS
-
-
Method Detail
-
compile
public CompilerBasedTransformer.CompileResult compile(java.nio.file.Path path, java.lang.String code)
-
transformed
public boolean transformed(Result result)
-
runtime
public java.lang.String runtime(java.lang.String library)
-
compiler
protected Compiler compiler()
-
options
protected CompilerOptions options()
-
setOptions
protected void setOptions(CompilerOptions options)
-
-