New in Rhino 1.7R2
From MDC
Contents |
[edit] Doctest
See http://blog.norrisboyd.com/2008/03/doctest-in-rhino.html
[edit] Better line editing for Rhino shell
See http://blog.norrisboyd.com/2008/03/better-line-editing-for-rhino-shell.html
[edit] Debugger, license
Thanks to the sharp eyes of Hannes Wallnoefer, who spotted a more-liberally licensed version of files we depended on for the Rhino debugger GUI, we now have the debugger fully built and shipped with Rhino.
See Rhino License for details on the new license for files in the debugger.
[edit] Simplified semantics for Java exceptions in JavaScript catch scope
In version 1.7R1, catching a Java exception in JavaScript created a JavaScript Error object:
js> var exn;
js> try { (new java.util.ArrayList()).get(3); } catch (e) { exn = e; }
JavaException: java.lang.IndexOutOfBoundsException: Index: 3, Size: 0
js> exn instanceof Error
true
js> exn instanceof java.lang.IndexOutOfBoundsException
false
Information was lost in that there was no way to recover the underlying Java exception. To work around this problem, some extensions were added to Rhino. The first was a property javaException that referenced the Java exception:
js> exn.javaException java.lang.IndexOutOfBoundsException: Index: 3, Size: 0 js> exn.javaException instanceof java.lang.IndexOutOfBoundsException true
Additionally, a name __exception__ was defined in the catch scope and bound to the Java exception:
js> try { (new java.util.ArrayList()).get(3); } catch (e) { exn = __exception__; }
org.mozilla.javascript.WrappedException: Wrapped java.lang.IndexOutOfBoundsException: Index: 3, Size: 0 (<stdin>#10)
Note that in this case exn refers to a NativeJavaObject wrapping a WrappedException wrapping the IndexOutOfBoundsException!
XXXX figure out how to fix
Norrisboyd 05:04, 11 March 2008 (PDT)