Nashorn on the module-path
sormuras at gmail.com
Sun May 26 10:05:02 UTC 2019
Pardon me, James! Here follows the original text copied from "jigaw-dev".
although I'm aware of Nashorn being deprecated for removal
and that the JUnit team also tends to remove the experimental
support for script-based test execution  in the near future,
I'd like to learn the reason for why a global script binding behaves
differently when running on the module-path or on the class-path.
I guess(!), it boils down to swallowed illegal access exception
that happens when a simple Java object is put into a Binding.
Running on the class-path, an instance of SimpleDynamicMethod
from package "jdk.dynalink.beans" is wrap around a method
of the bound object. When running on the module-path, the
type within the Nashorn is reported as: "undefined".
I compiled a small example project  that describes and
demonstrates the issue. Please view the README.md file for
details. You may reproduce the issue by launching `jshell build.jsh`
on any platform having JDK 11+ installed within the root directory
of the project.
Thanks in advance for any hint and clue.
On Sun, May 26, 2019 at 12:02 PM James Laskey <james.laskey at oracle.com>
> Christian, I can’t see the rest of the thread so I don’t have a context.
> Sent from my iPhone
> On May 26, 2019, at 6:17 AM, Christian Stein <sormuras at gmail.com> wrote:
> >> Have you brought this up on nashorn-dev...
> > No, but cc-ed that list now.
> >> ...as this might require digging into the dynalink linker
> >> and how method handles are used.
> > Do you think it's still worth the effort in regard of Nashorn
> > being deprecated for removal? Perhaps the underlying
> > reason may show up on/in a different module, soon.
> > Said that, the JUnit 5 team decided to remove "script-
> > based conditions" from Jupiter. So, "we" won't be affected
> > by this issue in the near future anymore.
> >  https://github.com/junit-team/junit5/issues/1882
> > On Sun, May 26, 2019 at 10:35 AM Alan Bateman <Alan.Bateman at oracle.com>
> > wrote:
> >> On 16/05/2019 15:02, Christian Stein wrote:
> >> :
> >> It didn't emit any new line. Is there another debug switch I can enable?
> >> Have you brought this up on nashorn-dev as this might require digging
> >> the dynalink linker and how method handles are used.
> >> -Alan
More information about the nashorn-dev