com.google.javascript.jscomp.Compiler.getErrorManager()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(1.8k)|赞(0)|评价(0)|浏览(204)

本文整理了Java中com.google.javascript.jscomp.Compiler.getErrorManager()方法的一些代码示例,展示了Compiler.getErrorManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Compiler.getErrorManager()方法的具体详情如下:
包路径:com.google.javascript.jscomp.Compiler
类名称:Compiler
方法名:getErrorManager

Compiler.getErrorManager介绍

暂无

代码示例

代码示例来源:origin: angular/clutz

public boolean hasErrors() {
 return compiler.getErrorManager().getErrorCount() > 0;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
 public String call() {
  // Neither the compiler nor the options is thread safe, so they can't be
  // saved as instance state.
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  Compiler compiler = new Compiler(new PrintStream(baos));
  // Threads can't be used in small unit tests.
  compiler.disableThreads();
  SourceFile externs = SourceFile.fromCode("externs", "function Symbol() {}");
  SourceFile sourceFile = SourceFile.fromCode(path, js);
  compiler.<SourceFile, SourceFile>compile(
    ImmutableList.<SourceFile>of(externs),
    ImmutableList.<SourceFile>of(sourceFile),
    getOptions());
  if (compiler.getErrorManager().getErrorCount() > 0) {
   String message;
   try {
    message = baos.toString(StandardCharsets.UTF_8.name());
   } catch (UnsupportedEncodingException e) {
    throw new RuntimeException(e);
   }
   throw new IllegalStateException(message);
  }
  return compiler.toSource();
 }
});

代码示例来源:origin: org.scala-js/closure-compiler-java-6

ErrorManager errorManager = driver.getCompiler().getErrorManager();
System.out.println("Compiler results: " + errorManager.getErrorCount()
  + " errors and " + errorManager.getWarningCount() + " warnings.");

代码示例来源:origin: com.google.javascript/closure-compiler

ConformanceConfig.newBuilder().addRequirement(cleanedRequirement).build();
ErrorManager oldErrorManager = compiler.getErrorManager();
final ImmutableList.Builder<JSError> errors = ImmutableList.builder();
try {

相关文章

Compiler类方法