scriptPath = mergePath;
}
block = null;
JavaCompiler compiler = JavaCompiler.create(getClassLoader());
compiler.setClassDir(workPath);
parseClass = new ParseClass(name, className);
parseClass.setParser(this);
if (is.getPath() != null && is.getPath().getLastModified() > 0)
parseClass.setSourcePath(is.getPath());
globalFunction = parseClass.newFunction(null, ESId.intern("global"), false);
globalFunction.setFast(isFast);
staticFunction = parseClass.newFunction(null, ESId.intern("__es_static"), false);
parseClass.setGlobal(globalFunction);
if (isEval) {
block = Block.create(this, globalFunction);
block.finish();
function = parseClass.newFunction(globalFunction, ESId.intern("eval"), false);
function.setEval();
}
else
function = globalFunction;
block = Block.create(this, function);
parseBlock(true);
block.finish();
if (lexer.peek() != Lexer.EOF)
throw expect(L.l("end of file"));
block = Block.create(this, staticFunction);
block.finish();
synchronized (LOCK) {
Path path = workPath.lookup(className.replace('.', '/') + ".java");
path.getParent().mkdirs();
WriteStream os = path.openWrite();
os.setEncoding("JAVA");
parseClass.writeCode(os);
os.close();
Script script;
try {
compiler.compile(className.replace('.', '/') + ".java", null);
script = loadScript(className);
} catch (Exception e) {
throw new ESParseException(e);
}