Update dependency org.mozilla:rhino to v1.8.0 #75

Merged
renovate[bot] merged 4 commits from renovate/org.mozilla-rhino-1.x into helma-🐜 2025-01-03 10:08:53 +00:00
renovate[bot] commented 2023-08-27 10:53:51 +00:00 (Migrated from github.com)

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
org.mozilla:rhino (source) 1.7.13 -> 1.8.0 age adoption passing confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

mozilla/rhino (org.mozilla:rhino)

v1.8.0

January 2, 2025

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.

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!

v1.7.15

May 3, 2024

Highlights of this release include:

  • 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!

v1.7.14

January 6, 2022


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [org.mozilla:rhino](https://mozilla.github.io/rhino/) ([source](https://redirect.github.com/mozilla/rhino)) | `1.7.13` -> `1.8.0` | [![age](https://developer.mend.io/api/mc/badges/age/maven/org.mozilla:rhino/1.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/org.mozilla:rhino/1.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/org.mozilla:rhino/1.7.13/1.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/org.mozilla:rhino/1.7.13/1.8.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>mozilla/rhino (org.mozilla:rhino)</summary> ### [`v1.8.0`](https://redirect.github.com/mozilla/rhino/blob/HEAD/RELEASE-NOTES.md#Rhino-180) #### January 2, 2025 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](https://redirect.github.com/mozilla/rhino/blob/master/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](https://mozilla.github.io/rhino/compat/engines.html) for the details. 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! ### [`v1.7.15`](https://redirect.github.com/mozilla/rhino/blob/HEAD/RELEASE-NOTES.md#Rhino-1715) #### May 3, 2024 Highlights of this release include: - 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! ### [`v1.7.14`](https://redirect.github.com/mozilla/rhino/blob/HEAD/RELEASE-NOTES.md#Rhino-1714) #### January 6, 2022 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/antville/helma). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42NC44IiwidXBkYXRlZEluVmVyIjoiMzkuODUuMCIsInRhcmdldEJyYW5jaCI6ImhlbG1hLfCfkJwifQ==-->
p3k commented 2023-08-27 11:19:57 +00:00 (Migrated from github.com)

Copied from https://github.com/antville/helma/pull/39#issuecomment-1554574060:

Currently throwing exception trying to access cleanly installed welcome app:

[ERROR] [welcome-1] GET:favicon.ico org.mozilla.javascript.EvaluatorException: Wrapped java.lang.NullPointerException (/Users/tobi/Desktop/helma/modules/tools/Global/helma.Inspector.js#304)
org.mozilla.javascript.EvaluatorException: Wrapped java.lang.NullPointerException (/Users/tobi/Desktop/helma/modules/tools/Global/helma.Inspector.js#304)
        at helma.scripting.rhino.RhinoCore.getValidPrototype(RhinoCore.java:448)
        at helma.scripting.rhino.RhinoCore.getNodeWrapper(RhinoCore.java:695)
        at helma.scripting.rhino.RhinoCore$WrapMaker.wrap(RhinoCore.java:1136)
        at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:1258)
        at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:1176)
        at org.mozilla.javascript.Context.toObject(Context.java:1640)
        at helma.scripting.rhino.RhinoEngine.setGlobals(RhinoEngine.java:203)
        at helma.framework.core.RequestEvaluator.initGlobals(RequestEvaluator.java:1008)
        at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:222)
        at java.base/java.lang.Thread.run(Thread.java:829)
_Copied from https://github.com/antville/helma/pull/39#issuecomment-1554574060:_ Currently throwing exception trying to access cleanly installed welcome app: ```shell [ERROR] [welcome-1] GET:favicon.ico org.mozilla.javascript.EvaluatorException: Wrapped java.lang.NullPointerException (/Users/tobi/Desktop/helma/modules/tools/Global/helma.Inspector.js#304) org.mozilla.javascript.EvaluatorException: Wrapped java.lang.NullPointerException (/Users/tobi/Desktop/helma/modules/tools/Global/helma.Inspector.js#304) at helma.scripting.rhino.RhinoCore.getValidPrototype(RhinoCore.java:448) at helma.scripting.rhino.RhinoCore.getNodeWrapper(RhinoCore.java:695) at helma.scripting.rhino.RhinoCore$WrapMaker.wrap(RhinoCore.java:1136) at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:1258) at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:1176) at org.mozilla.javascript.Context.toObject(Context.java:1640) at helma.scripting.rhino.RhinoEngine.setGlobals(RhinoEngine.java:203) at helma.framework.core.RequestEvaluator.initGlobals(RequestEvaluator.java:1008) at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:222) at java.base/java.lang.Thread.run(Thread.java:829) ```
p3k commented 2024-05-18 11:13:45 +00:00 (Migrated from github.com)

The Rhino commit causing the exception is 73a8b29d79 – found via git bisect.

A work-around is patching MemberBox.java with an NP check:

diff --git a/src/org/mozilla/javascript/MemberBox.java b/src/org/mozilla/javascript/MemberBox.java
index a24d4743..e97a2811 100644
--- a/src/org/mozilla/javascript/MemberBox.java
+++ b/src/org/mozilla/javascript/MemberBox.java
@@ -202,10 +202,13 @@ final class MemberBox implements Serializable {
         if (target instanceof Delegator) {
             target = ((Delegator) target).getDelegee();
         }
-        for (int i = 0; i < args.length; ++i) {
-            if (args[i] instanceof Delegator) {
-                args[i] = ((Delegator) args[i]).getDelegee();
-            }
+
+        if (args != null) {
+          for (int i = 0; i < args.length; ++i) {
+              if (args[i] instanceof Delegator) {
+                  args[i] = ((Delegator) args[i]).getDelegee();
+              }
+          }
         }
 
         try {
The Rhino commit causing the exception is https://github.com/mozilla/rhino/commit/73a8b29d795af5c828d67334e75e46f4e3d2d183 – found via `git bisect`. A work-around is patching [MemberBox.java](https://github.com/mozilla/rhino/blob/085d561953cd2ac0d28e8ff69b4b5742cd6074f5/src/org/mozilla/javascript/JavaMembers.java#L103) with an NP check: ```diff diff --git a/src/org/mozilla/javascript/MemberBox.java b/src/org/mozilla/javascript/MemberBox.java index a24d4743..e97a2811 100644 --- a/src/org/mozilla/javascript/MemberBox.java +++ b/src/org/mozilla/javascript/MemberBox.java @@ -202,10 +202,13 @@ final class MemberBox implements Serializable { if (target instanceof Delegator) { target = ((Delegator) target).getDelegee(); } - for (int i = 0; i < args.length; ++i) { - if (args[i] instanceof Delegator) { - args[i] = ((Delegator) args[i]).getDelegee(); - } + + if (args != null) { + for (int i = 0; i < args.length; ++i) { + if (args[i] instanceof Delegator) { + args[i] = ((Delegator) args[i]).getDelegee(); + } + } } try { ```
p3k commented 2024-05-18 11:48:56 +00:00 (Migrated from github.com)

Digging deeper, there is a weird inconsistency between Context.emptyArgs and ScriptRuntime.emptyArgs: although the former is set to the latter in Context.java and ScriptRuntime.java, resp., both are not the same in JavaMembers.java:

// Context.java
public static final Object[] emptyArgs = ScriptRuntime.emptyArgs;

// ScriptRuntime.java
public static final Object[] emptyArgs = new Object[0];

// JavaMembers.java
rval = bp.getter.invoke(javaObject, Context.emptyArgs);
// Context.emptyArgs != ScriptRuntime.emptyArgs 🤷 

At this point, Context.emptyArgs is indeed null, while ScriptRuntime.emptyArgs is not! This can be used as an alternative work-around here:

diff --git a/src/org/mozilla/javascript/JavaMembers.java b/src/org/mozilla/javascript/JavaMembers.java
index f9c457b0..58fc8f3b 100644
--- a/src/org/mozilla/javascript/JavaMembers.java
+++ b/src/org/mozilla/javascript/JavaMembers.java
@@ -100,7 +100,7 @@ class JavaMembers {
             if (member instanceof BeanProperty) {
                 BeanProperty bp = (BeanProperty) member;
                 if (bp.getter == null) return Scriptable.NOT_FOUND;
-                rval = bp.getter.invoke(javaObject, Context.emptyArgs);
+                rval = bp.getter.invoke(javaObject, ScriptRuntime.emptyArgs);
                 type = bp.getter.method().getReturnType();
             } else {
                 Field field = (Field) member;

It begs the question if this is a Rhino issue, or if there is some Helma code causing this…

Digging deeper, there is a weird inconsistency between `Context.emptyArgs` and `ScriptRuntime.emptyArgs`: although the former is set to the latter in [Context.java](https://github.com/mozilla/rhino/blob/085d561953cd2ac0d28e8ff69b4b5742cd6074f5/src/org/mozilla/javascript/Context.java#L356) and [ScriptRuntime.java](https://github.com/mozilla/rhino/blob/085d561953cd2ac0d28e8ff69b4b5742cd6074f5/src/org/mozilla/javascript/ScriptRuntime.java#L5030), resp., both are *not the same* in [JavaMembers.java](https://github.com/mozilla/rhino/blob/085d561953cd2ac0d28e8ff69b4b5742cd6074f5/src/org/mozilla/javascript/JavaMembers.java#L103): ```java // Context.java public static final Object[] emptyArgs = ScriptRuntime.emptyArgs; // ScriptRuntime.java public static final Object[] emptyArgs = new Object[0]; // JavaMembers.java rval = bp.getter.invoke(javaObject, Context.emptyArgs); // Context.emptyArgs != ScriptRuntime.emptyArgs 🤷 ``` At this point, `Context.emptyArgs` is indeed `null`, while `ScriptRuntime.emptyArgs` is not! This can be used as an alternative work-around here: ```diff diff --git a/src/org/mozilla/javascript/JavaMembers.java b/src/org/mozilla/javascript/JavaMembers.java index f9c457b0..58fc8f3b 100644 --- a/src/org/mozilla/javascript/JavaMembers.java +++ b/src/org/mozilla/javascript/JavaMembers.java @@ -100,7 +100,7 @@ class JavaMembers { if (member instanceof BeanProperty) { BeanProperty bp = (BeanProperty) member; if (bp.getter == null) return Scriptable.NOT_FOUND; - rval = bp.getter.invoke(javaObject, Context.emptyArgs); + rval = bp.getter.invoke(javaObject, ScriptRuntime.emptyArgs); type = bp.getter.method().getReturnType(); } else { Field field = (Field) member; ``` It begs the question if this is a Rhino issue, or if there is some Helma code causing this…
renovate[bot] commented 2025-01-03 10:02:27 +00:00 (Migrated from github.com)

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

### Edited/Blocked Notification Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR. You can manually request rebase by checking the rebase/retry box above. ⚠️ **Warning**: custom changes will be lost.
p3k commented 2025-01-03 10:08:44 +00:00 (Migrated from github.com)

The NPE issue described in https://github.com/mozilla/rhino/issues/1477 is fixed – including rhino-all.jar and so far Helma works with Rhino 1.8 as well.

The NPE issue described in https://github.com/mozilla/rhino/issues/1477 is fixed – including rhino-all.jar and so far Helma works with Rhino 1.8 as well.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: antville/helma#75
No description provided.