Bug report: JavaScript arrays are not coerced into Java arrays when calling Java functions that expect arrays
Tal Liron
tal.liron at threecrickets.com
Tue Oct 8 04:54:14 PDT 2013
Lets say we have a Java class with this method:
class MyClass {
void myMethod(String[] arguments) {}
}
And in Nashorn we call it like so:
myInstance.myMethod(['a', 'b', 'c'])
The JavaScript array seems to be converted into a string (as "a,b,c"),
and then wrapped in a Java string array as its single element before
sending to Java.
In Rhino, the above works as expected.
More information about the nashorn-dev
mailing list