File: test.js
# this test requires -scripting mode
$EXEC.apply(this, ["ls"]);
print($OUT);
-------
The above test fails with the following tip. But, if passes if this changeset is reverted.
$ hg tip
changeset: 1313:a24cb0bf79bc
tag: tip
user: mhaupt
date: Tue Jun 09 09:27:02 2015 +0200
summary: 8080490: add $EXECV command to Nashorn scripting mode
$ jjs -scripting -J-Djava.ext.dirs=dist test.js
Exception in thread "main" java.lang.ClassCastException: Cannot cast jdk.nashorn.internal.runtime.Undefined to [Ljava.lang.Object;
at java.lang.invoke.MethodHandleImpl.newClassCastException(MethodHandleImpl.java:361)
at java.lang.invoke.MethodHandleImpl.castReference(MethodHandleImpl.java:356)
at jdk.nashorn.internal.scripts.Script$Recompilation$1$test.:program(test.js:3)
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:640)
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228)
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393)
at jdk.nashorn.tools.Shell.apply(Shell.java:397)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:326)
at jdk.nashorn.tools.Shell.run(Shell.java:172)
at jdk.nashorn.tools.Shell.main(Shell.java:136)
at jdk.nashorn.tools.Shell.main(Shell.java:112)