|From:||Roberto Chinnici (Robe...@Sun.COM)|
|Date:||Aug 29, 2007 12:41:33 pm|
I think the answer is yes, but there are a few things than may need to be disentangled first.
Let me explain how the Phobos debugger works.
We don't use Rhino out of the JDK. Instead, we take a Mozilla Rhino release and add our own JSR-223 scripting engine to it.
The debugger translates Rhino events (which have a number of drawbacks I won't get into here) into its own kind of events and exposes them through a listener interface (com.sun.phobos.debug.DebuggerListener). This interface is implemented by the NetBeans portion of the Phobos debugger so taht debug events can drive the debugger UI in NetBeans.
In theory, it is possible to perform all these steps from NetBeans without instantiating a Phobos container. The only catch is that currently the DebuggerImpl class requires a Phobos container to be present. I imagine it'd be possible to come up with a minimal DebuggerImpl that does not depend on the rest of the container, then use it to run single scripts in debug mode.
As for the eval() function, it's part of the standard JSR-223 ScriptEngine interface so the Phobos JSR-223 engine for Rhino supports it.
Andrew Mickish wrote:
Is it possible to explicitly call 'eval' in Phobos (like JDK 1.6 ScriptEngine.eval())?
Maybe this hypothetical right-click-eval feature could be written as a plug-in, or something unique to my NetBeans installation. But what is the API it calls?
Thanks for your advice,