New in Rhino 1.7R3

  • Revision slug: New_in_Rhino_1.7R3
  • Revision title: New in Rhino 1.7R3
  • Revision id: 11524
  • Created:
  • Creator: simen1
  • Is current revision? Yes
  • Comment no changes

Revision Content

ECMAScript 5 support

ECMAScript 5 support was added to Rhino by Raphael Speyer during a Google Summer of Code project mentored by Norris Boyd. Rhino 1.7R3 supports most of ES5 except for Strict Mode.

JavaScript 1.8 support

Rhino 1.7R3 has partial support for JavaScript 1.8 contributed by Hannes Wallnöfer and Andreas Bolka. This includes expression closures and destructuring assignment shorthand but not generator expressions.

Note that JavaScript 1.8 features have to be enabled explicitly by selecting language version 180 in the shell, or Context.VERSION_1_8 in embedded mode.

New AST API

Steve Yegge has contributed a new AST API to Rhino which should be useful for people building JavaScript specific tools. The AST classes are in the org.mozilla.javascript.ast package.

CommonJS module support

 A fully compliant CommonJS module implementation was contributed by Attila Szegedi. CommonJS modules are also available in the Rhino shell using the -modules, -main, and -sandbox command line options.

JS Objects implement Java collections

JavaScript Objects now implement the java.util.Map interface while Arrays implement java.util.List. This means that JavaScript objects can be passed seamlessly to Java methods expecting a Map while arrays can be passed to methods expecting a List or java.util.Collection.

JSDoc comment parsing

The Rhino parser is now capable of recognizing JSDoc-like comments (starting with /**). This feature is disabled by default and has to be enabled by setting the corresponding flag in the CompilerEnviron object.

Performance improvements

Rhino has seen some performance improvements since the last release which are most notable when running benchmarks or the test suite.

Revision Source

<h3 id="ECMAScript_5_support">ECMAScript 5 support</h3>
<p>ECMAScript 5 support was added to Rhino by Raphael Speyer during a Google Summer of Code project mentored by Norris Boyd. Rhino 1.7R3 supports most of ES5 except for Strict Mode.</p>
<h3 id="JavaScript_1.8_support">JavaScript 1.8 support</h3>
<p>Rhino 1.7R3 has partial support for <a href="/en/JavaScript/New_in_JavaScript/1.8" title="https://developer.mozilla.org/en/new_in_javascript_1.8">JavaScript 1.8</a> contributed by Hannes Wallnöfer and Andreas Bolka. This includes expression closures and destructuring assignment shorthand but not generator expressions.</p>
<p>Note that JavaScript 1.8 features have to be enabled explicitly by selecting language version <span style="font-family: Courier New;">180</span> in the shell, or <span style="font-family: Courier New;">Context.VERSION_1_8</span> in embedded mode.</p><h3 id="New_AST_API">New AST API</h3>
<p>Steve Yegge has contributed a new AST API to Rhino which should be useful for people building JavaScript specific tools. The AST classes are in the <span style="font-family: Courier New;">org.mozilla.javascript.ast</span> package.</p>
<h3 id="CommonJS module_support">CommonJS module support</h3>
<p> A fully compliant <a class=" external" href="http://wiki.commonjs.org/wiki/Modules/1.1.1" title="http://wiki.commonjs.org/wiki/Modules/1.1.1">CommonJS module implementation</a> was contributed by Attila Szegedi. CommonJS modules are also available in the Rhino shell using the <span style="font-family: Courier New;">-modules</span>, <span style="font-family: Courier New;">-main</span>, and <span style="font-family: Courier New;">-sandbox</span> command line options.</p>
<h3 id="JS Objects_implement_Java_collections">JS Objects implement Java collections</h3>
<p>JavaScript Objects now implement the <span style="font-family: Courier New;">java.util.Map</span> interface while Arrays implement <span style="font-family: Courier New;">java.util.List</span>. This means that JavaScript objects can be passed seamlessly to Java methods expecting a Map while arrays can be passed to methods expecting a List or java.util.Collection.</p>
<h3 id="JSDoc_comment_parsing">JSDoc comment parsing</h3>
<p>The Rhino parser is now capable of recognizing JSDoc-like comments (starting with <span style="font-family: Courier New;">/**</span>). This feature is disabled by default and has to be enabled by setting the corresponding flag in the <span style="font-family: Courier New;">CompilerEnviron</span> object.</p>
<h3 id="Performance_improvements">Performance improvements</h3>
<p>Rhino has seen some performance improvements since the last release which are most notable when running benchmarks or the test suite.</p>
Revert to this revision