Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

renovate[bot]
Copy link

@renovate renovate bot commented Aug 27, 2023

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.

@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 52418a6 to 025c96c Compare August 27, 2023 11:13
@p3k
Copy link
Member

p3k commented Aug 27, 2023

Copied from #39 (comment):

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)

@p3k p3k added the needs-work label Aug 27, 2023
@renovate renovate bot changed the title fix(deps): update dependency org.mozilla:rhino to v1.7.14 Update dependency org.mozilla:rhino to v1.7.14 Aug 28, 2023
@p3k p3k added core dependency Pull request that updates a dependency file labels Aug 28, 2023
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 025c96c to 2d24670 Compare December 30, 2023 14:12
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch 2 times, most recently from 2b5d34a to b41c1b2 Compare January 9, 2024 08:34
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from b41c1b2 to fe7bad0 Compare May 4, 2024 05:25
@renovate renovate bot changed the title Update dependency org.mozilla:rhino to v1.7.14 Update dependency org.mozilla:rhino to v1.7.15 May 4, 2024
@p3k
Copy link
Member

p3k commented May 18, 2024

The Rhino commit causing the exception is mozilla/rhino@73a8b29 – 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 {

@p3k
Copy link
Member

p3k commented May 18, 2024

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…

@p3k p3k force-pushed the helma- branch 2 times, most recently from bd2c103 to b8abe5a Compare May 18, 2024 14:47
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from d231fd8 to adecb51 Compare May 18, 2024 20:11
@p3k p3k force-pushed the helma- branch 7 times, most recently from 61c4440 to daf8da6 Compare May 18, 2024 23:23
@p3k p3k self-assigned this May 25, 2024
@p3k p3k marked this pull request as draft May 25, 2024 15:44
@p3k p3k force-pushed the helma- branch 2 times, most recently from bb72f3f to ebf9b22 Compare May 25, 2024 17:34
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from dc16b50 to 526235b Compare June 1, 2024 16:35
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 526235b to 77dde4a Compare June 1, 2024 16:38
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 77dde4a to 57013f8 Compare June 1, 2024 16:42
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 57013f8 to d1c9373 Compare June 1, 2024 16:49
@p3k p3k force-pushed the helma- branch 3 times, most recently from 892ac82 to 85f6102 Compare June 1, 2024 17:06
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from d1c9373 to 434c535 Compare June 1, 2024 17:06
@p3k p3k force-pushed the helma- branch 3 times, most recently from 24be038 to f2feef4 Compare June 1, 2024 20:29
@p3k p3k force-pushed the helma- branch 2 times, most recently from d1ddce0 to 5de4616 Compare June 15, 2024 19:37
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 434c535 to 3b5a454 Compare June 17, 2024 21:45
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 3b5a454 to 4ebbcb0 Compare January 3, 2025 08:07
@renovate renovate bot changed the title Update dependency org.mozilla:rhino to v1.7.15 Update dependency org.mozilla:rhino to v1.8.0 Jan 3, 2025
@renovate renovate bot force-pushed the renovate/org.mozilla-rhino-1.x branch from 4ebbcb0 to 28887aa Compare January 3, 2025 09:32
Copy link
Author

renovate bot commented Jan 3, 2025

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
Copy link
Member

p3k commented Jan 3, 2025

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

@p3k p3k marked this pull request as ready for review January 3, 2025 10:08
@p3k p3k merged commit 49c1be9 into helma-🐜 Jan 3, 2025
3 checks passed
@renovate renovate bot deleted the renovate/org.mozilla-rhino-1.x branch January 3, 2025 10:09
@p3k p3k removed the needs-work label Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core dependency Pull request that updates a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant