Nashorn does not support implicit array conversion b/w script and Java array [ Re: some nashorn testing]
A. Sundararajan
sundararajan.athijegannathan at oracle.com
Thu Jan 10 05:30:53 PST 2013
Hi Andreas,
As I said in my last email, Nashorn does not support implicit conversion
from JS array to Java array. You need to call Java.toJavaArray method to
do the conversion. I've attached modified ObjectArray.java with this
email -- both single dimensional and 2 D array need conversion. With the
changed file, I get proper output
Thanks,
-Sundar
Andreas Rieber wrote:
> Hi Marcus,
>
> i improved the test and found another case (sorry for that ;-)
>
> Whenever you have a fix, i could provide the patch for jrunscript
> (workaround working):
>
> ./usr/local/src/jdk8/build/linux-i586/j2sdk-image/bin/jrunscript -cp
> /usr/local/src/jdk8/nashorn/dist/nashorn.jar:. -l nashorn
> nashorn> printf("%03d %2.2f%n",1,2);
> 001 2.00
> nashorn>
>
> - Andreas
>
> On 09.01.13 16:50, Marcus Lagergren wrote:
>> My bad. This actually reproduces through the JSR223 bridge. Must be
>> an eval related problem. I am on it!
>>
>> /M
>>
>>
>> On Jan 9, 2013, at 4:26 PM, Marcus Lagergren
>> <marcus.lagergren at oracle.com> wrote:
>>
>>> Where did you get/build your nashorn.jar? We'll get proper
>>> versioning in there as soon as we've integrated fully with the
>>> OpenJDK build system. I still get nothing when I manually build the
>>> latest nashorn.jar from the openjdk and run the JS snippet from the
>>> command line with java -jar nashorn.jar <program.js> (Haven't gone
>>> through the script engine bridge, but as it seems to be a JavaScript
>>> problem it should be sufficient to run it as a standalone script).
>>> This very much looks like a bug that I fixed before christmas and
>>> pushed into the closed repo - I've verified that it made it into the
>>> openjdk source.
>>> /M
>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ObjectArray.java
Url: http://mail.openjdk.java.net/pipermail/nashorn-dev/attachments/20130110/c5aeb3df/ObjectArray.java
More information about the nashorn-dev
mailing list