-
Bug
-
Resolution: Other
-
P3
-
None
-
8, 9
-
generic
-
generic
1. names visible in the global namespace in rhino and not in nashorn
compile and run the test Jtest.java. the output got from rhino and nashorn, that show that
rhino made visible the predefined javascript functions, while nashorn does not.
Have strived to make a java program get these names out of its global object, without success.
This is important because a java program that calls the javascript engine
pushing function definitions into it may want to reject upfront the redefinition
of predefined functions (which could alter the behavior of user defined functions
that use them).
2. the opposite
compile and run the test Jtest3.java. Tthe output got from both rhino and nashorn shows that
in this case some predefined names appear in the namespace of nashorn, and not in the one of rhino.
This is a big problem for an application that with rhino did not have any name
clashes, and that now has.
As it seems, nashorn has a namespace that behaves quite differently from the
one of rhino. An application has to cope with it changing substantially the way
it handles its names.
Also have an application that uses the javascript engine, and that runs with
nashorn in a time that is 4 times that of running it with rhino. Admittedly, this could
depend on the above mentioned differences.
Proposal: document what names are in the nashorn global namespace, and how
a java program can get them, and what happens when a java program defines
new names. Support both engines for at least one year more, giving time to developers
to change their applications to cope with this (there are substantial changes to be
done).
Priority justification:
Impact: High, regression
Likelhood: Medium, intermittent.
Workaround: Medium, unknown
ILW = HMM => P2
- relates to
-
JDK-8034959 one line javascript scripts are 5 times slower in nashorn vs rhino
- Closed