CodeBaseX / jav8

Automatically exported from code.google.com/p/jav8
0 stars 0 forks source link

This not set on invokeMethod OSX (not working also with invokeInterface) #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
test case :

ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("jav8");
Invocable invocable = (Invocable) engine;

engine.eval(
          "function Person(me) { this.me = me };"+
          "Person.prototype.say =  function (you) {" +
          "  return this.me + ' say, hello ' + you; "+
          "}; "+
          "var me = new Person('Flier'); "
    );

V8Context ctxt = ((V8ScriptEngine) engine).getV8Context();

V8Object me = (V8Object) ctxt.getGlobal().get("me");
String result = ( (String) invocable.invokeMethod(me, "say", "francois")); 
///[object Object] say, hello francois

Original issue reported on code.google.com by francois...@gmail.com on 22 Jul 2013 at 8:29

GoogleCodeExporter commented 9 years ago
please verify the patch with SVN trunk code after r86

Original comment by flier...@gmail.com on 23 Dec 2013 at 11:20