Hello -
I'd like to be able to do something like the following:
js> (function(){ eval("var t = 5;"); })();
js> t
5
However it appears as if performing the following always throws an
exception (even though it is supposed to only throw exceptions under
strict mode - as far as I can tell):
js> eval.call(this, "var t=5;");
js: "<stdin>", line 22: uncaught JavaScript runtime exception:
EvalError: Function "eval" must be called directly, and not by way of
a function of another name.
As that is the only avenue for evaluating a piece of code within the
global context - are there any alternatives?
I found this previous thread but it requires adding additional classes
or methods to external Java files - is there a way to achieve the
above while remaining in "JavaScript-land"?
http://groups.google.com/group/mozilla.dev.tech.js-engine.rhino/browse_thread/thread/d35cf92bbccc5efe
--John
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino