I tried to mock up a simple ESP console, where I could enter a line of
script and have it evaluated on the server side.
Everything works well, except that variables are not persisted between
eval()s. So that:

engine.eval("var foo = ''bar");
engine.eval("foo.length");

... does not return 3 (the length of "bar"), but instead throws a
ReferenceError: "foo" is not defined.

When I run the code in outside of Sling, I get a
com.sun.script.javascript.RhinoScriptEngine instead of the
o.a.s.scripting.javascript.internal.RhinoJavaScriptEngine. With Sun's
implementation, I get the result I want.

Is this a bug, and if not, is there a way to accomplish what I want?

-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Sommerrogata 13-15, N-0255 Oslo, Norway
+ 47 22 00 84 00 / +47 21 531941, ext 2070

Reply via email to