[EMAIL PROTECTED] a écrit :
> My idea was to change Rhino so to change the eval function and add a
> printing statement.
>
> Is it feasable?
Yes but not from within the shell. You have to modifiy the sheel or
build your own environment.
For the "printing eval" part: create a java class implementing
org.mozilla.javascript.Callable with the method below:
Object call(Context cx, Scriptable scope, Scriptable thisObj,
java.lang.Object[] args) {
System.out.println(args[0]);
return cx.evaluateString(scope, args[0], "-", 1);
}
And put an instance of it in the global scope under the name "eval".
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino