Skip to content
Browse files

Run -e/--expression code in main worker

  • Loading branch information...
1 parent fa278ee commit d84ddf5a4b908a36f0bba53bad970f3437194c54 @hns hns committed Feb 25, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/org/ringojs/engine/RhinoEngine.java
View
4 src/org/ringojs/engine/RhinoEngine.java
@@ -208,7 +208,9 @@ public Object evaluateExpression(String expr)
Repository repository = repositories.get(0);
Scriptable parentScope = mainScope != null ? mainScope : globalScope;
ModuleScope scope = new ModuleScope("<expr>", repository, parentScope);
- retval = cx.evaluateString(scope, expr, "<expr>", 1, null);
+ Resource res = new StringResource("<expr>", expr, 1);
+ ReloadableScript script = new ReloadableScript(res, this);
+ retval = mainWorker.evaluateScript(cx, script, scope);
return retval instanceof Wrapper ? ((Wrapper) retval).unwrap() : retval;
} finally {
Context.exit();

0 comments on commit d84ddf5

Please sign in to comment.
Something went wrong with that request. Please try again.