javax.script rhino (javascript) support added

Mark Wielaard mark at klomp.org
Mon Jun 23 09:29:39 UTC 2008


Hi,

This patch adds javax.script javascript support through rhino. CCed
build-dev since it is mainly build stuff and there doesn't seem to be
another list for scripting stuff (not that I am advocating yet another
list!)

The idea is pretty simple, if configure can detect rhino being installed
on the system already (either the rhino.jar from fedora or the js.jar
from debian) it uses that instead of the closed and unreleased sun
internal classes. The only wrinkle is that the javascript support is
written to expect the implementation on the bootclasspath, I would have
liked it to be possible to just add it to the extension dir. This is
solved by patching the hardcoded hotspot boostrap path and creating the
correct symlink in the jre lib dir.

Maybe the modules project and/or the extension/plugin ideas from icedtea
can help a bit in the future to rewrite these kind of things a little
cleaner: http://icedtea.classpath.org/wiki/PackagingExtensions

2008-06-22  Mark Wielaard  <mark at klomp.org>

        * patches/icedtea-rhino.patch: New patch.
        * Makefile.am: Add RHINO_JAR to environment variable lists.
        (ICEDTEA_PATHCES): Add patches/icedtea-rhino.patch.
        * Makefile.in: Regenerated.
        * acinclude.m4 (FIND_RHINO_JAR): New.
        * configure.ac: Use FIND_RHINO_JAR.
        * configure: Regenerated.

Committed to icedtea6.

With this patch the jrunscript works perfectly, and the javax.script and
sun.tools.jscript jtreg tests all pass except for one. The
sun/tools/jrunscript/jrunscriptTest.sh test insists that 2 + 5 = 7.0,
while our current implementation says it is 7 (without the .0). The
tests references two bugs (6265810,6705893) which might help analyze
this, unfortunately they are closed to the public (is there anybody who
could see what these bugs were about?).

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rhino.patch
Type: text/x-patch
Size: 8747 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/build-dev/attachments/20080623/86108978/rhino.patch>


More information about the build-dev mailing list