Nashorn bug in Java 8 u20? For trivial TypeScript code
Hannes Wallnoefer
hannes.wallnoefer at oracle.com
Wed Oct 8 15:18:30 UTC 2014
Hi Kaj Magnus,
I can reproduce the problem with 8u20, however it seems to be fixed in
JDK 9 and JDK8u40. You can download a preview release of 8u40 here:
https://jdk8.java.net/download.html
Please let us know if still run into problems using 8u40.
Hannes
Am 2014-10-08 um 07:16 schrieb Kaj Magnus Lindberg:
> Hi dear Nashorn developers,
>
> The example below throws an ArrayIndexOutOfBoundsException. I'm thinking
> there's a Nashorn bug that you might want to fix?
>
> I'm getting the impression that currently it's not possible to run
> TypeScript compiled code in Nashorn, because of this bug. The snippet below
> is a compiled trivial TypeScript module.
>
> File test.js:
>
> var test;(function (test) {
> (function (renderer) {
> var posts = {
> 0: null,
> 1: null,
> 2: null,
> 3: null // comment out this line --> no exception thrown
> };
> })(test.renderer = {}); // comment out 'test.renderer = ' --> no
> exception thrown})(test = {});
>
> Then run the script like so:
> /usr/lib/jvm/java-8-oracle/bin/jjs test.js
>
>
> Operating system: Linux Mint 17, 64 bit. Java version:
>
> $ java -version
> java version "1.8.0_20"Java(TM) SE Runtime Environment (build
> 1.8.0_20-b26)Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed
> mode)
>
>
> (There's also a StackOverflow question about this:
> http://stackoverflow.com/questions/26189940/java-8-nashorn-arrayindexoutofboundsexception
> )
>
> Best regards, KajMagnus
More information about the nashorn-dev
mailing list