Subj : RE: Use org.mozilla.javascript.tools.debugger in application which is embedding Rhino? To : netscape.public.mozilla.jseng From : Merten Schumann Date : Fri May 28 2004 02:06 pm > So could you send your changes as diff -u against the Rhino tip? Here we go. Same code as in main(), just without the redirection. I had these boolean flags to make the debugger stop at the first script, but since there's now main.dim.breakFlag = true; this is not necessary. --- //d/work/cvs/mozilla/js/rhino/toolsrc/org/mozilla/javascript/tools/debug ger/Main.java Thu May 27 13:26:59 2004 +++ //d/work/rhino_cvs/toolsrc/org/mozilla/javascript/tools/debugger/Main.ja va Fri May 28 12:56:59 2004 @@ -165,5 +165,27 @@ org.mozilla.javascript.tools.shell.Main.exec(args); } + // same as plain main(), stdin/out/err redirection removed + public static void mainEmbedded(final String title) + { + Main main = new Main(title==null ? "Rhino JavaScript Debugger (embedded usage)" : title); + main.dim.breakFlag = true; + main.setExitAction(new Runnable() { + public void run() { + System.exit(0); + } + }); + + main.dim.enableForAllNewContexts(); + main.setScopeProvider(new ScopeProvider() { + public Scriptable getScope() { + return org.mozilla.javascript.tools.shell.Main.getScope(); + } + }); + + main.debugGui.pack(); + main.debugGui.setSize(600, 460); + main.debugGui.setVisible(true); + } } My application still works fine, even with the latest Rhino tip :-) Merten .