Skip to content

Commit

Permalink
Fix issues with external scripts for rhinoJs
Browse files Browse the repository at this point in the history
  • Loading branch information
arunans23 committed Jul 9, 2024
1 parent c743c92 commit 8bbf011
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@ protected void initScriptEngine() {
ScriptEngineWrapper sew;
if (language.equals(NASHORN_JAVA_SCRIPT)) {
sew = new ScriptEngineWrapper(engineManager.getEngineByName(NASHORN));
} else if (language.equals(RHINO_JAVA_SCRIPT)) {
sew = new ScriptEngineWrapper(engineManager.getEngineByExtension("jsEngine"));
} else {
sew = new ScriptEngineWrapper(engineManager.getEngineByExtension(language));
}
Expand All @@ -708,6 +710,9 @@ protected void initScriptEngine() {


this.multiThreadedEngine = scriptEngine.getFactory().getParameter("THREADING") != null;
if (language.equals(JAVA_SCRIPT)) {
this.multiThreadedEngine = true;
}
log.debug("Script mediator for language : " + language +
" supports multithreading? : " + multiThreadedEngine);

Expand Down Expand Up @@ -759,8 +764,10 @@ public ScriptEngineWrapper getNewScriptEngine() {
if (scriptEngineWrapper == null) {
if (language.equals(NASHORN_JAVA_SCRIPT)) {
scriptEngineWrapper = new ScriptEngineWrapper(engineManager.getEngineByName(NASHORN));
} else if (language.equals(RHINO_JAVA_SCRIPT)) {
scriptEngineWrapper = new ScriptEngineWrapper(engineManager.getEngineByExtension("jsEngine"));
} else {
scriptEngineWrapper = new ScriptEngineWrapper(engineManager.getEngineByExtension(GRAALVM));
scriptEngineWrapper = new ScriptEngineWrapper(engineManager.getEngineByExtension(language));
}
}
// fall back
Expand Down

0 comments on commit 8bbf011

Please sign in to comment.