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

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

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

Compiler.getSourceFileByName介绍

暂无

代码示例

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

@Override
public String getSourceLine(String sourceName, int lineNumber) {
 if (lineNumber < 1) {
  return null;
 }
 SourceFile input = getSourceFileByName(sourceName);
 if (input != null) {
  return input.getLine(lineNumber);
 }
 return null;
}

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

@Override
public Region getSourceRegion(String sourceName, int lineNumber) {
 if (lineNumber < 1) {
  return null;
 }
 SourceFile input = getSourceFileByName(sourceName);
 if (input != null) {
  return input.getRegion(lineNumber);
 }
 return null;
}

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

public CharSequence getSourceFileContentByName(String sourceName) {
 SourceFile file = getSourceFileByName(sourceName);
 checkNotNull(file);
 try {
  return file.getCode();
 } catch (IOException e) {
  return null;
 }
}

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

@Override
public String getSourceLine(String sourceName, int lineNumber) {
 if (lineNumber < 1) {
  return null;
 }
 SourceFile input = getSourceFileByName(sourceName);
 if (input != null) {
  return input.getLine(lineNumber);
 }
 return null;
}

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

@Override
public Region getSourceRegion(String sourceName, int lineNumber) {
 if (lineNumber < 1) {
  return null;
 }
 SourceFile input = getSourceFileByName(sourceName);
 if (input != null) {
  return input.getRegion(lineNumber);
 }
 return null;
}

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

/**
 * Returns the result of the compilation.
 */
public Result getResult() {
 Set<SourceFile> transpiledFiles = new HashSet<>();
 if (jsRoot != null) {
  for (Node scriptNode : jsRoot.children()) {
   if (scriptNode.getBooleanProp(Node.TRANSPILED)) {
    transpiledFiles.add(getSourceFileByName(scriptNode.getSourceFileName()));
   }
  }
 }
 return new Result(getErrors(), getWarnings(),
   this.variableMap, this.propertyMap,
   this.anonymousFunctionNameMap, this.stringMap, this.functionInformationMap,
   this.sourceMap, this.externExports, this.cssNames, this.idGeneratorMap, transpiledFiles);
}

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

String relativePath = resolveSibling(sourceMapOriginalPath, resultOriginalPath);
SourceFile source = getSourceFileByName(relativePath);
if (source == null && !isNullOrEmpty(resultOriginalPath)) {
 source =

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

if (compiler.getSourceFileByName(outputFileName) != null) {
 compiler.report(
   JSError.make(OUTPUT_SAME_AS_INPUT_ERROR, outputFileName));

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

if (compiler.getSourceFileByName(outputFileName) != null) {
 compiler.report(
   JSError.make(OUTPUT_SAME_AS_INPUT_ERROR, outputFileName));

相关文章

Compiler类方法