if(m.hasSeparateImpl()) {
continue;
}
globalScope.put(m.getMethodName(), globalScope,
new FunctionObject(
m.getMethodName(),
this.getClass().getMethod(m.getMethodName(), m.getMethodArgs()),
globalScope)
);
}
// globalScope.put("log", globalScope, new FunctionObject("log", this.getClass().getMethod("log", Object.class), globalScope));
// globalScope.put("fork", globalScope, new FunctionObject("fork", this.getClass().getMethod("fork"), globalScope));
// globalScope.put("kill", globalScope, new FunctionObject("kill", this.getClass().getMethod("kill", String.class), globalScope));
// globalScope.put("exec", globalScope, new FunctionObject("exec", this.getClass().getMethod("exec", String.class, String.class), globalScope));
// globalScope.put("listen", globalScope, new FunctionObject("listen", this.getClass().getMethod("listen", NativeObject.class), globalScope));
// globalScope.put("say", globalScope, new FunctionObject("say", this.getClass().getMethod("say", String.class, NativeObject.class), globalScope));
// globalScope.put("ask", globalScope, new FunctionObject("ask", this.getClass().getMethod("ask", String.class, NativeObject.class), globalScope));
// globalScope.put("get", globalScope, new FunctionObject("get", this.getClass().getMethod("get", String.class), globalScope));
// globalScope.put("sleep", globalScope, new FunctionObject("sleep", this.getClass().getMethod("sleep", Object.class), globalScope));
// globalScope.put("exit", globalScope, new FunctionObject("exit", this.getClass().getMethod("exit", Object.class), globalScope));
String source;
try {
source = IOUtils.toString(globalScope.getClass().getClassLoader().getResourceAsStream("wait.js"));
} catch (IOException e) {
throw new ScriptusRuntimeException(e);
}
Function getLastPid = new FunctionObject("_intern_getLastPid", this.getClass().getMethod("_intern_getLastPid"),
globalScope);
Function wait_intern = new FunctionObject("_intern_wait", this.getClass().getMethod("_intern_wait", String.class), globalScope);
Function wait_ctor = cx.compileFunction(globalScope, source, "wait_internal.js", 0, null);
Function wait = (Function) wait_ctor.call(cx, globalScope, null, new Object[] { wait_intern, getLastPid });