Some JavaScript files that were developed for the Rhino shell use load () to load additional JavaScript files. I am trying to inject functions from one of these Rhino JavaScript files using javax.script. Unfortunately, the load () function is not implemented by javax.script JavaScript. When I try to eval () a script containing load (), the following error occurs:
com.sun.script.javascript.RhinoScriptEngine:-1:in `eval': javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: ReferenceError: "load" is not defined.
Does javax.script provide the load () function when evaluating a JavaScript file from a Java program (not from a shell)?
javascript load rhino javax.script
sutch
source share