Skip to content
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

Current VMBridge is not suitable for modular JDKs #1076

Open
carlosame opened this issue Oct 22, 2021 · 1 comment
Open

Current VMBridge is not suitable for modular JDKs #1076

carlosame opened this issue Oct 22, 2021 · 1 comment
Labels
Java Compatibility Issues related to Rhino being compatible to (new) Java releases

Comments

@carlosame
Copy link
Contributor

VMBridge allows some customization by trying to load a org.mozilla.javascript.VMBridge_custom, however due to modularity access rules such a class would not be allowed to load in modular JDKs. Then VMBridge_jdk18 is loaded, but that class is not 100% suitable for modular JDKs (for example it handles proxy objects in a pre-modular way which could lead to failures).

As a subset of what is currently done in PR #1072, a few changes could be made to VMBridge, respecting the current API signature but changing the way that it is loaded:

  1. The VMBridge_custom would be located at org.mozilla.javascript.bridge which could be provided by a different module.
  2. Provide a VMBridge_jdk11 which inherits from a new VMBridge_jdk8 (keeping a VMBridge_jdk18 would be confusing) and uses the modular API.

I could modify #1072 to provide the above changes (and leave the protected access changes for a later PR).

carlosame added a commit to carlosame/rhino that referenced this issue Oct 24, 2021
carlosame added a commit to carlosame/rhino that referenced this issue Nov 2, 2021
carlosame added a commit to carlosame/rhino that referenced this issue Nov 21, 2021
@p-bakker p-bakker added the Java Compatibility Issues related to Rhino being compatible to (new) Java releases label May 9, 2022
@p-bakker
Copy link
Collaborator

@rbri @gbrail could you comment on whether this is still something relevant?

I tried following all the cases and (not merged) PRs related to the VMBridge, modular Java and Java 11 and could not make heads or tails out of it.

@rbri you closed your PR in this area (#1070) in favor of #1072, but neither ever got merged

@gbrail you mentioned in #1479 (comment) that we might not need a VMBridge at all now...

I'm lost... 🤔 Should we fix something, remove something, do nothing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java Compatibility Issues related to Rhino being compatible to (new) Java releases
Projects
None yet
Development

No branches or pull requests

2 participants