New in Rhino 1.6R6
Rhino 1.6R6 adds several new features.
Briefly, Rhino reports warnings in strict mode for
- assignments to undefined variables
- references to undefined properties
- inconsistent return statements in a function
- duplicate parameter names
- variables that hide parameters
- assignment in a conditional (Note: you can suppress this warning by including an extra set of parentheses around the assignment)
- trailing comma in object initializer (Note: this is always a full error in Rhino)
- indirect calls to eval
- useless expressions
To enable strict mode for the Rhino shell, add
-strict to the command line. If you are using the API directly, set the Context feature
It's also possible to cause all warnings to be treated as errors. Add
-fatal-warnings to the shell command line or set the Context feature
See bug 378790 for nitty gritty details.
Since Rhino 1.6R1, Rhino has used the Apache XMLBeans library to support E4X. In Rhino 1.6R6 the E4X support has been rewritten to rely solely on the DOM3 APIs supported natively by Java 1.5. (Pre-1.5 users can use DOM3 using Java's endorsed standards override mechanism if they have a DOM3-capable XML parser.) As of this release, the XMLBeans implementation remains the default if XMLBeans classes are found on the classpath; otherwise, the native DOM implementation is used if DOM3 is present. If neither XMLBeans nor DOM3 are present, E4X is not available.
Rhino now comes with test drivers written in Java. These drivers can be used to test Rhino if you are making any changes to the core engine. They are designed to use the tests shared with the C-based SpiderMonkey engine in mozilla/js/tests in CVS.
See Running the Rhino tests for details on how to execute the tests using JsDriver.
Java J2SE 5 added support for variable argument lists in constructors and methods. Rhino 1.6R6 now supports calling these methods and constructors using variable argument lists. For example,
java.lang.System.out.format("%3.1f%s\n", 1.6, "R6");
See bug 382457 for more details.