use of com.google.javascript.jscomp.SourceFile in project ow by vtst.
the class DefaultExternsProvider method loadExterns.
/**
* @return The default externs, as a list of AST factories.
* @throws IOException
*/
private static List<JSExtern> loadExterns() throws IOException {
List<SourceFile> sourceFiles = getAsSourceFiles();
ArrayList<JSExtern> externs = new ArrayList<JSExtern>(sourceFiles.size());
for (SourceFile sourceFile : sourceFiles) externs.add(new JSExtern(sourceFile));
return externs;
}
use of com.google.javascript.jscomp.SourceFile in project AngularBeans by bessemHmidi.
the class ClosureCompiler method compile.
public String compile(String code) {
Compiler compiler = new Compiler();
compiler.disableThreads();
SourceFile extern = SourceFile.fromCode("externs.js", "function alert(x) {}");
SourceFile input = SourceFile.fromCode("input.js", code);
compiler.compile(extern, input, options);
return compiler.toSource();
}
Aggregations