Skip to content

Releases: mozilla/rhino

Rhino 1.9.0

22 Dec 23:18

Choose a tag to compare

This release represents about a year of work on Rhino by a growing team of contributors.

Some of the improvements include:

  • Compatibility improvements in areas like destructuring and spread syntax.
  • Performance improvements from 10 to 30% in benchmarks like Delta Blue, Earley-Boyer, and Crypto in both interpreted and compiled mode
  • Better support for generics and other things when Java integration is used.

Some other improvements:

JavaScript Language Updates:

  • ES6+: Significant advancements in destructuring, spread syntax for
    arrays/objects, Symbol API, and improved let/const scoping.
    TypedArray.from/of and BigInt.asUintN/asIntN fixes.
  • RegExp: New features like named capture groups, lookbehind
    assertions, and Unicode mode support.
  • Future ES (ES2024/2025): Early implementation of proposals such as
    Promise.withResolvers, Promise.try, ArrayBuffer transfer methods, and
    new Set methods.

Core Engine Enhancements:

  • Major Refactoring: Extensive migration of built-in objects to a
    lambda-based architecture and a comprehensive overhaul of the
    interpreter bytecodes for better performance and maintainability.
  • Concurrency & Interop: Continued focus on thread safety improvements
    and enhanced Java interoperability, including better generics
    support.

Going forward -- we have lots of plans for Rhino, including some changes that may
affect compatibility for projects that embed Rhino into larger frameworks. We think
that these changes will be worth it because they will unlock better language
compatibility and performance.

As such, the next version going forward will be 2.0.0-SNAPSHOT.

16 different contributors gave their time and energy to Rhino 1.9.0.

Thanks to everyone who contributed!

New Contributors

Full Changelog: Rhino1_8_0_Release...Rhino1_9_0_Release

Rhino 1.8.1

03 Dec 04:12

Choose a tag to compare

This release fixes a problem with formatting of floating-point numbers to strings that may result in very bad performance in some cases.

We recommend that all users of Rhino upgrade to this release, and to Java 17 or 21, if possible.

Rhino 1.7.15.1

03 Dec 04:12

Choose a tag to compare

This release fixes a problem with formatting of floating-point numbers to strings that may result in very bad performance in some cases.

Projects that are unable to upgrade to Rhino 1.8.1, or unable to upgrade to at least Java 11, should use this release.

Rhino 1.7.14.1

03 Dec 04:13

Choose a tag to compare

This release fixes a problem with formatting of floating-point numbers to strings that may result in very bad performance in some cases.

Projects that are unable to upgrade to Rhino 1.8.1, or unable to upgrade to at least Java 11, should use this release.

Rhino 1.8.0

03 Jan 07:49

Choose a tag to compare

Highlights

Rhino 1.8.0 contains some significant changes, so we're incrementing the final version number for the first time in a very long time. Here are a few highlights:

  • Rhino now requires Java 11 minimum. We currently test against Java 11, 17, and 21.
  • Rhino has been broken down into individual Java modules that are properly encapsulated as Java Modules. See README.md for a breakdown of which modules are which -- short answer is that everyone will need the "rhino" module and many will need others.
  • Older code not able to adapt to using multiple JARS can still use the "rhino-all" module, which publishes an "all-in-one" JAR like the old "rhino.jar".
  • The default language level is "VERSION_ES6". That means that modern JavaScript features supported by Rhino will work by default.
  • There are big improvements in compatibility, including support for "super", reflect and proxy, and lots of other language features. See the compatibility table for the details.

JARs have been published to Maven Central and GitHub packages.

Thanks to all who contributed -- we had 24 contributors to this release, with some new contributors who added significant capabilities. Please keep the contributions and attention coming!

What's Changed

Read more

Rhino 1.7.15

04 May 00:46

Choose a tag to compare

May 3, 2024

Links

Highlights

  • Basic support for "rest parameters"
  • Improvements in Unicode support
  • "Symbol.species" implemented in many places
  • More correct property ordering in many places
  • And many more improvements and bug fixes

This release includes committs from 29 different committers. Thanks to you all for your help!

What's Changed

Read more

Rhino 1.7.14

06 Jan 22:02

Choose a tag to compare

January 6, 2022

Links

Highlights

Features

ECMAScript features

Non-ECMAScript features

  • #153 stack property on Error Constructor (@gbrail)
  • #888 support for Mozilla-styled Stack formatting (@rbri)

All features

(Potential) Breaking Changes

  • #820 Introduced Context.FEATURE_ENABLE_JAVA_MAP_ACCESS, defaulting to false.
    This, by default, disables direct property access on Java maps from JavaScript, which got introduced in #713 and was released with Rhino 1.7.13:
    var h = new java.util.HashMap();
    h.put('a', 123);
    h.a;  // 123.0`)
    
    The rationale for this change can be seen in #820 and the JavaDoc on the aforementioned feature flag.

Bugs

All bug fixes

Performance

All performance enhancements

Java Interop

  • #839 JavaScript for-of loop support for Java Iterables (@tuchida)
  • #860 / #857 JSON.stringify support on Java Objects (@tonygermano / @rPraml)
  • #1031 delete operator and .length setting support in JavaScript on Java Lists (@rPraml)
  • #901 java.util.subList() support on JavaScript Arrays in Java (@rPraml)
  • #889 Automatically increase size of Java List instances on .put(...) if required (@rPraml)

All Java Interop related cases

Embedding Rhino

  • #864 Context now implements Closable (@gbrail)
  • #865 Introduction of LambdaFunction and LambdaConstructor, to be used to represent Java lambda functions as native JavaScript functions and also can be used to construct an entire class out of lambdas (@gbrail)
  • #911 Throw InternalError instead of wrapped JavaException if thrown Java Exception class is not visible due to class shutter (@youngj)
  • #1004 Support to define how unhandled Promise exceptions are handled (a NOP by default)

All Rhino embedding related cases

Test262 suite

  • Running against a much newer version of Test262 suite
  • Improved documentation for running the Test262 suite + more options to make running the tests easier & faster
  • #930 Support added for automatically regenerating the test262.properties file based on actual passage of tests
  • #930 Improved feedback about reason of test failures

Distribution

  • #873 Automatic module names

Internals

  • #878 Removed idSwitch
  • #896 SlotMap and Slot refactoring
  • #922 Started extracting logic related to Abstract Operations as defined by the ECMAScript specification

Misc.

  • #661 Rhino now listed in the kangax ES6 Compatibility table (must select the Show obsolete platforms in the upperleft corner)
  • #661 Rhino now available as a compilation target in Babel through @babel/preset-env:
{
  "targets": {
    "rhino": "1.7.13"
  }
}
  • Introduced Java Code Formatting through spotless
  • Moved to CircleCI (instead of Travis)
  • Enabled Gitlab CI, running tests on multiple Java versions'

Thanks!

This release contains more than 350 commits from 23 contributors. Thanks to everyone who helped!

Rhino 1.7.14 RC1

18 Nov 22:13

Choose a tag to compare

Rhino 1.7.14 RC1 Pre-release
Pre-release

November 18, 2021

Links

Highlights

Features

ECMAScript features

Non-ECMAScript features

  • #153 stack property on Error Constructor (@gbrail)
  • #888 support for Mozilla-styled Stack formatting (@rbri)

All features

Bugs

All bug fixes

Performance

All performance enhancements

Java Interop

  • #839 JavaScript for-of loop support for Java Iterables (@tuchida)
  • #860 / #857 JSON.stringify support on Java Objects (@tonygermano / @rPraml)
  • #1031 delete operator and .length setting support in JavaScript on Java Lists (@rPraml)
  • #901 java.util.subList() support on JavaScript Arrays in Java (@rPraml)
  • #889 Automatically increase size of Java List instances on .put(...) if required (@rPraml)

All Java Interop related cases

Embedding Rhino

  • #864 Context now implements Closable (@gbrail)
  • #865 Introduction of LambdaFunction and LambdaConstructor, to be used to represent Java lambda functions as native JavaScript functions and also can be used to construct an entire class out of lambdas (@gbrail)
  • #911 Throw InternalError instead of wrapped JavaException if thrown Java Exception class is not visible due to class shutter (@youngj)

All Rhino embedding related cases

Test262 suite

  • Running against a much newer version of Test262 suite
  • Improved documentation for running the Test262 suite + more options to make running the tests easier & faster
  • #930 Support added for automatically regenerating the test262.properties file based on actual passage of tests
  • #930 Improved feedback about reason of test failures

Distribution

  • #873 Automatic module names
  • Link to hosted JavaDoc on https://javadoc.io (instead of self hosting via GitHub Pages), with the added benefit of being able to access the JavaDoc of previous Rhino releases as well as the latest

Internals

  • #878 Removed idSwitch
  • #896 SlotMap and Slot refactoring
  • #922 Started extracting logic related to Abstract Operations as defined by the ECMAScript specification

Misc.

  • #661 Rhino now listed in the kangax ES6 Compatibility table (must select the Show obsolete platforms in the upperleft corner)
  • #661 Rhino now available as a compilation target in Babel through @babel/preset-env:
{
  "targets": {
    "rhino": "1.7.13"
  }
}
  • Introduced Java Code Formatting through spotless
  • Moved to CircleCI (instead of Travis)
  • Enabled Gitlab CI, running tests on multiple Java versions
  • Improved release notes (@p-bakker)

Thanks!

This release contains more than 300 commits from 21 contributors. Thanks to everyone who helped!

Rhino 1.7.13

02 Sep 19:12

Choose a tag to compare

Script Engine support

Now that Nashorn has been deprecated, a number of poeple have asked about using
Rhino with the standard Java "ScriptEngine" interface. This release supports that.

However, in order to avoid breaking existing code, the script engine is
shipped in a separate JAR. Use the "rhino-engine" jar along with the
standard "rhino" jar to include this feature.

Generator Support

This release supports generators based on the ES6-standard "function *"
syntaxt.

Other important changes

This release also includes a number of quality and consistency fixes from five contributors.
As always, check out the compatibility table
to see where Rhino stands today.

Gregory Brail (18):

  • Start on 1.7.13.
  • Add a build config for CircleCi.
  • Upgrade Gradle version to 6.5.
  • Update max workers.
  • Add support for ES6 generators.
  • Make "GeneratorFunction" pattern work in interpreted mode.
  • Complete implementation of GeneratorFunction.
  • Diagnostics to discover test timeouts.
  • Implement standard Java ScriptEngine
  • Change MozillaSuiteBenchmark to not fork threads.
  • Try to improve performance of MozillaSuiteTest
  • Disable some very slow tests
  • Start using JMH for benchmarks.
  • Many small fixes suggested by FindBugs and other linters
  • Turn off all the Mozilla tests that use the "BigO" function.
  • Move "BodyCodegen" into a file with the appropriate name.
  • Add feature flag for changes to Function.proto
  • Make proto more closely match the spec

Karl Tauber (2):

  • Debugger fixes for FlatLaf (https://github.com/JFormDesigner/FlatLaf): - make renderer tree row height same as table row height - increase monospaced font size in script source and evaluation view if L&F uses larger font - remove renderer tree border if L&F sets one (built in L&F do not)
  • Debugger: fix NPE in variables view when expanding "CallSite"

Sylvain Jermini (7):

  • improve java.util.{List,Map} interop
  • travis: switch from trusty to xenial + set explicit -Xss in tests
  • try to fix circle, increase Xss
  • Fix failing string.trim.doctest in java11.
  • NativeDate: DateFormat, use explicit pattern, has the default has changed from java8 to 9. See https://stackoverflow.com/q/53317365
  • add java11 to travis test matrix
  • various fixes so the javadoc linter is happy

hjx胡继续 (2):

  • Add String.fromCodePoint()
  • fromCharCode optimize

ian4hu (5):

  • Add String.prototype.trimStart String.prototype.strimEnd
  • style: code style
  • test: string test with hex code instead of literal
  • remove unused StringBuilder
  • fix tests in test262/built-ins/String/fromCodePoint/*

leela52452 (1):

  • fix OWASP Cheat Sheet markdown format

RBRi (48):

  • switch value and done
  • make some method protected to support rhino-external implementations
  • NativeArrayBuffer slice() length is 2
  • fix String.indexOf and String.includes when searching for an empty st… (#747)
  • fix string.split with limit 0
  • fix for issue #665 (maybe we have to adjust the version switch to version 1_6)
  • fix for the recursion detection when converting an array into a string
  • fix #670
  • add testcase for issue #656
  • Symbol.length is 0 fixes #648
  • add testcase for issue #651
  • fix type o the expected value
  • improve seal() and freeze() processing; fixes #174
  • An error should be thrown when defining a property for a read-only variable in strict mode fixes 573
  • code cleanup
  • Do not save/share an instance of NativeArrayBuffer in a static variable. This introduces really strange side effects, because the instance is available (and changeable) from javascript code. These changes are 'persistent' in a way that starting a fresh rhino instance still uses this changed object.
  • various fixes for array calls using this pattern Array.prototype.foo.call(null, ....);
  • fix issue #648
  • fix Object.getOwnPropertyDescriptor for index properties on native strings
  • Function.proto ignores write access
  • improved regexp parser based on commit 2164382 from anba
  • fix handling of undefined parameter value in String.normalize()
  • it should not be possible to change the [[Prototype]] of a non-extensible object; some cleanup
  • add version guard
  • fix all this-value-not-obj-coercible.js tests for string
  • checkstyle fixes
  • fix test suite setup
  • use the RangeError construction helper
  • improved handling of negative ArrayBuffer size fixes #708
  • in ES6 TypedArray constructors are only callable via new
  • avoid some auto boxing use Double.valueOf instead of new some cleanup try to optimize the code a bit to avoid unnecessary conversations and Double object creation make some methods static
  • regular expressions are not functions in the context of string replace fixes #726
  • improved regex range handling
  • do not inherit strict mode when parsing a function body
  • code style fix
  • fix wrong start object for getter in Object.assign
  • use Undefined.isUndefined()
  • String.prototype[Symbol.iterator].call(undefined) has to throw because undefined is not coercible
  • enable more test cases
  • reduce auto boxing to be able to better control this and avoid boxing if possible
  • make a bunch of methods static
  • code cleanup
  • make the inner class static (this makes also SpotBugs happy)
  • Object.setPrototypeOf() arg[0] has to be coercible
  • fix one more case
  • match
  • search
  • throw if the lastIndex prop of an regex is readonly

Rhino 1.7.12

13 Jan 20:40

Choose a tag to compare

XML external entities disabled by default

As of this release, Rhino makes "XML external entity injections" more difficult
by disabling fetching of external DTDs and stylesheets by default,
as recommended in the (OWASP Cheat Sheet)
[https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.md].
Even though this may break some existing projects, the fact that this
vulnerability is in the OWASP top 10 makes it important enough to change
the default.

Developers who still need this old capability can re-enable it by setting the
Context feature flag FEATURE_ENABLE_XML_SECURE_PARSING to false. (The default
is true.)

New JAR for embedding use cases

This release also includes a second JAR artifact, "rhino-runtime.jar". This is
simply the existing Rhino JAR with the "tools" source directory excluded.
This directory includes the Rhino shell as well as the default "Global"
object, which includes capabilities to load and process external source
code.

Since some automated source-scanning tools mark these capabilties as insecure,
this new JAR provides a way to only include the parts of Rhino that embedders
typically need without pulling in additional capabilities.

Developers who typically embed "rhino.jar" might consider embedding "rhino-runtime.jar"
instead if they do not need all this.

Thanks to the following developers for the contributions below!

Aditya Pal (1):

  • Fix syntax error for comments in array (#607)

Chris Smith (1):

  • Adding secure configuration for XML parsers (#600)

Gregory Brail (12):

  • Update versions for 1.7.12 release.
  • Fix a code generation bug for generators.
  • Fix "fall through" comment.
  • Fix static analysis around NaN values.
  • More isNaN fixes and one rounding bug.
  • Make XML processor configuration more robust.
  • Enable SpotBugs plugin.
  • Fix minor static analysis findings.
  • Increase Travis timeout.
  • Disable more flaky "BigO" tests.
  • Fix handling of "return" in iterators.
  • Undo setting some members "final".

Ivan Di Francesco (1):

  • Fix warnings (#596)

Roland Praml (2):

  • FIX: NativeJavaObject.getDefaultValue recognizes numbers correctly
  • #511 fixing InterfaceAdapter abstract name lookup.

Stijn Kliemesch (7):

  • Private static method ScriptRuntime.enumInitOrder(Context,IdEnumeration) no longer expects given IdEnumeration's property obj to be of type ScriptableObject specifically, only of type SymbolScriptable.
  • Added testclass IterableTest to test iterable implementations, currently with one testcase for a host object, specifically one that uses Array Iterator.
  • Added more tests to IterableTest.
  • Fix for #616 (#617)
  • Fixes for calling several Object.prototype members.
  • Fixed dynamic scoping for implementations of Object.create and Object.defineProperties
  • Testcase for dynamic scoping and Object.create.

nename0 (2):

  • Fix Array.include return a wrapped Boolean
  • implement Array.includes to align to specs

RBRi (20):

  • fix for Map/Set working with ConsString as key also; closes #583
  • fix propertyIsEnumerable when using an index to access string; closes #582
  • ignore surplus search/match/replace parameters; closes #581
  • add support for setPrototypeOf
  • fixed imports
  • RangeError should be throw if the argument of Number.prototype.toFixed is less than 0 fixes #587
  • fix interpreter fallback when using streams (fixes #592)
  • Parser already always reads the reader into a string. Move this reader handling to the Context to be able to fall back to the interpreter in all cases.
  • fix imports
  • functions declared as var f = function f() {...} within a function should not impact higher scope variable with the same name
  • functions declared as var f = function f() {...} within a function should not impact higher scope variable with the same name
  • fix Boolean(document.all)
  • many more tests are passing already and some cleanup
  • add tests for built-ins/ThrowTypeError and built-ins/TypedArray
  • add tests for built-ins/TypedArrays
  • fix BYTES_PER_ELEMENT property
  • fix BYTES_PER_ELEMENT prototype property
  • fix TypedArray constructor arity
  • Fix issue with parseInt's handling of leading zeroes
  • #529 (#628)