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.ObjectWraps 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 SourceFileEMPTYprotected static DiagnosticGroupES5_WARNINGSprotected static SourceFileEXTERNS
-
Constructor Summary
Constructors Constructor Description CompilerSupplier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompilerBasedTransformer.CompileResultcompile(java.nio.file.Path path, java.lang.String code)protected Compilercompiler()protected CompilerOptionsoptions()java.lang.Stringruntime(java.lang.String library)protected voidsetOptions(CompilerOptions options)booleantransformed(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)
-
-