本文整理了Java中com.google.javascript.jscomp.Compiler.getOptions()
方法的一些代码示例,展示了Compiler.getOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Compiler.getOptions()
方法的具体详情如下:
包路径:com.google.javascript.jscomp.Compiler
类名称:Compiler
方法名:getOptions
暂无
代码示例来源:origin: com.google.javascript/closure-compiler
@Override
void addComments(String filename, List<Comment> comments) {
if (!getOptions().preservesDetailedSourceInfo()) {
throw new UnsupportedOperationException(
"addComments may only be called in IDE mode.");
}
commentsPerFile.put(filename, comments);
}
代码示例来源:origin: com.google.javascript/closure-compiler
@Override
public List<Comment> getComments(String filename) {
if (!getOptions().preservesDetailedSourceInfo()) {
throw new UnsupportedOperationException(
"getComments may only be called in IDE mode.");
}
return commentsPerFile.get(filename);
}
代码示例来源:origin: com.google.javascript/closure-compiler
private PassConfig getCleanupPassConfig() {
return new CleanupPasses(getOptions());
}
代码示例来源:origin: org.scala-js/closure-compiler-java-6
private PassConfig getCleanupPassConfig() {
return new CleanupPasses(getOptions());
}
代码示例来源:origin: com.google.javascript/closure-compiler
/**
* Writes code to an output stream, optionally wrapping it in an arbitrary wrapper that contains a
* placeholder where the code should be inserted.
*
* @param module Which module to write. If this is null, write the entire AST.
*/
@GwtIncompatible("Unnecessary")
void writeOutput(
Appendable out,
Compiler compiler,
@Nullable JSModule module,
String wrapper,
String codePlaceholder,
@Nullable Function<String, String> escaper)
throws IOException {
if (compiler.getOptions().outputJs == OutputJs.SENTINEL) {
out.append("// No JS output because the compiler was run in checks-only mode.\n");
return;
}
checkState(compiler.getOptions().outputJs == OutputJs.NORMAL);
String code = module == null ? compiler.toSource() : compiler.toSource(module);
writeOutput(out, compiler, code, wrapper, codePlaceholder, escaper);
}
代码示例来源:origin: com.google.javascript/closure-compiler
@Override
boolean hasHaltingErrors() {
return !getOptions().canContinueAfterErrors() && errorManager.hasHaltingErrors();
}
代码示例来源:origin: com.google.javascript/closure-compiler
private synchronized void addFilesToSourceMap(Iterable<? extends SourceFile> files) {
// synchronized annotation guards concurrent access to sourceMap during parsing.
if (getOptions().sourceMapIncludeSourcesContent && getSourceMap() != null) {
for (SourceFile file : files) {
try {
getSourceMap().addSourceFile(file.getName(), file.getCode());
} catch (IOException e) {
throw new RuntimeException("Cannot read code of a source map's source file.", e);
}
}
}
}
代码示例来源:origin: com.google.javascript/closure-compiler
@Override
public void report(JSError error) {
CheckLevel level = error.getDefaultLevel();
if (warningsGuard != null) {
CheckLevel newLevel = warningsGuard.level(error);
if (newLevel != null) {
level = newLevel;
}
}
if (level.isOn()) {
initCompilerOptionsIfTesting();
if (getOptions().errorHandler != null) {
getOptions().errorHandler.report(level, error);
}
errorManager.report(level, error);
}
}
代码示例来源:origin: org.scala-js/closure-compiler-java-6
@Override
public void report(JSError error) {
CheckLevel level = error.getDefaultLevel();
if (warningsGuard != null) {
CheckLevel newLevel = warningsGuard.level(error);
if (newLevel != null) {
level = newLevel;
}
}
if (level.isOn()) {
initCompilerOptionsIfTesting();
if (getOptions().errorHandler != null) {
getOptions().errorHandler.report(level, error);
}
errorManager.report(level, error);
}
}
代码示例来源:origin: org.scala-js/closure-compiler-java-6
public TypeCheck(AbstractCompiler compiler,
ReverseAbstractInterpreter reverseInterpreter,
JSTypeRegistry typeRegistry,
TypedScope topScope,
MemoizedScopeCreator scopeCreator,
CheckLevel reportMissingOverride) {
this.compiler = compiler;
this.validator = compiler.getTypeValidator();
this.reverseInterpreter = reverseInterpreter;
this.typeRegistry = typeRegistry;
this.topScope = topScope;
this.scopeCreator = scopeCreator;
this.reportMissingOverride = reportMissingOverride;
this.reportUnknownTypes = ((Compiler) compiler).getOptions().enables(
DiagnosticGroups.REPORT_UNKNOWN_TYPES);
this.inferJSDocInfo = new InferJSDocInfo(compiler);
}
代码示例来源:origin: com.google.javascript/closure-compiler
@GwtIncompatible("Unnecessary")
void printBundleTo(Iterable<CompilerInput> inputs, Appendable out) throws IOException {
if (!compiler.getOptions().preventLibraryInjection) {
代码示例来源:origin: org.scala-js/closure-compiler-java-6
if (compiler.getOptions().exportTestFunctions && name.startsWith("test")) {
return;
内容来源于网络,如有侵权,请联系作者删除!