Skip to content
Snippets Groups Projects
Commit 96dc275a authored by Guy Zana's avatar Guy Zana
Browse files

java: make the context object publicly accessible in RhinoCLI

parent e7c05233
No related branches found
No related tags found
No related merge requests found
......@@ -13,22 +13,23 @@ public class RhinoCLI {
public static Global global = new Global();
public static Scriptable _scope;
public static Context _cx;
//
// Invoke the cli.js file take care of exposing all scriptable objects
// such as the tests
//
public static void main(String[] args) {
Context cx=Context.enter();
_cx = Context.enter();
try {
global.init(cx);
global.init(_cx);
_scope = ScriptableObject.getTopLevelScope(global);
ScriptableObject.defineClass(_scope, TCPEchoServerTest.class);
ScriptableObject.defineClass(_scope, ELFLoader.class);
FileReader cli_js = new FileReader("/console/cli.js");
cx.evaluateReader(_scope, cli_js, "cli.js", 1, null);
_cx.evaluateReader(_scope, cli_js, "cli.js", 1, null);
} catch (Exception ex) {
ex.printStackTrace();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment