@Test public void testExecFunc () throws ScriptLoadException { JSRhinoScriptEngine engine = new JSRhinoScriptEngine(); engine.compile("test", "function test(a) { return 2 * a; } "); engine.execScript("test", null); Object obj = engine.execFunc("test", 8); assertNotNull(obj); assertEquals(16d, obj); }
@Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); }
JSRhinoScriptEngine implements IScriptEngine { @Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); } }
JSRhinoScriptEngine implements IScriptEngine { @Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); } JSRhinoScriptEngine(); }
JSRhinoScriptEngine implements IScriptEngine { @Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); } JSRhinoScriptEngine(); @Override void compile(String scriptName, String programStr); @Override void loadFile(File file); @Override Object execFunc(String funcName, Object... args); @Override Object execFunc(String funcName); @Override Object execScript(String scriptName, Object... args); @Override void shutdown(); }
JSRhinoScriptEngine implements IScriptEngine { @Override public Object execFunc (String funcName, Object... args) { return ScriptableObject.callMethod(this.cx, this.scope, funcName, args); } JSRhinoScriptEngine(); @Override void compile(String scriptName, String programStr); @Override void loadFile(File file); @Override Object execFunc(String funcName, Object... args); @Override Object execFunc(String funcName); @Override Object execScript(String scriptName, Object... args); @Override void shutdown();  }