Nashorn bug in Java 8 u20? For trivial TypeScript code
Kaj Magnus Lindberg
kajmagnus79 at gmail.com
Wed Oct 8 05:16:45 UTC 2014
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