Closed GoogleCodeExporter closed 8 years ago
could you provide a complete demo to reproduce your issue?
The unit test has covered a similar usage
@Test
public void testJavaFunction() throws ScriptException, SecurityException, NoSuchMethodException
{
class Person {
public String hello(String name) {
return "hello " + name;
}
}
Person person = new Person();
this.eng.put("person", person);
this.eng.put("sprintf", this.getClass().getMethod("sprintf", String.class, V8Array.class));
assertEquals("hello flier", this.eng.eval("person.hello('flier')"));
assertEquals("hello world, 42", this.eng.eval("sprintf('hello %s, %d', ['world', 42]);"));
}
Original comment by flier...@gmail.com
on 14 Jun 2013 at 6:56
Original comment by flier...@gmail.com
on 14 Jun 2013 at 7:47
Original issue reported on code.google.com by
a.freddi...@gmail.com
on 22 Aug 2012 at 8:48