-
Notifications
You must be signed in to change notification settings - Fork 40
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
8258216: Allow Nashorn to operate when not loaded as a JPMS module #9
Conversation
👋 Welcome back attila! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have was non-modular nashorn tested? Don't the tests assume that nashorn is run as module?
Well, I did some light testing on the command line myself. I have this minimal application: import javax.script.*;
public class X {
public static void main(String[] args) throws ScriptException {
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByName("nashorn");
engine.eval("print('Hello, World!');");
}
} and running it from Nashorn directory (after JAR is built) with:
Before the changes it obviously causes:
while running it after the changes outputs
as expected. You're right that |
@@ -58,6 +58,7 @@ | |||
protected static final String SCRIPTS_PKG_INTERNAL = "org/openjdk/nashorn/internal/scripts"; | |||
|
|||
static final Module NASHORN_MODULE = Context.class.getModule(); | |||
static final boolean modular = NASHORN_MODULE.getName() != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @efge, thanks for making a comment in an OpenJDK project!
All comments and discussions in the OpenJDK Community must be made available under the OpenJDK Terms of Use. If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please Use "Add GitHub user efge for the summary.
If you are not an OpenJDK Author, Committer or Reviewer, simply check the box below to accept the OpenJDK Terms of Use for your comments.
- I agree to the OpenJDK Terms of Use for all comments I make in a project in the OpenJDK GitHub organization.
Your comment will be automatically restored once you have accepted the OpenJDK Terms of Use.
@sundararajana I created a test-demodulator branch in my own fork of the repo building on top of this branch that's running tests with Nashorn on classpath instead of on module path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Allow Nashorn to operate when not loaded as a JPMS module
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/nashorn pull/9/head:pull/9
$ git checkout pull/9