added support for interactive JavaScript debugger

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20647 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-08-13 02:03:36 +00:00
1 parent f49f68b29f
commit e2c163dcf5
2 files changed
+24 -2

No files matched your search

@@ -120,6 +120,7 @@ import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.jetty.webapp.WebXmlConfiguration;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.tools.shell.JSConsole;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.CSSParseException;
import org.w3c.css.sac.ErrorHandler;
@@ -480,6 +481,22 @@ public abstract class HudsonTestCase extends TestCase {
new BufferedReader(new InputStreamReader(System.in)).readLine();
}
/**
* Starts an interactive JavaScript debugger, and break at the next JavaScript execution.
*
* <p>
* This is useful during debugging a test so that you can step execute and inspect state of JavaScript.
* This will launch a Swing GUI, and the method returns immediately.
*
* <p>
* Note that installing a debugger appears to make an execution of JavaScript substantially slower.
*/
public void interactiveJavaScriptDebugger() {
org.mozilla.javascript.tools.debugger.Main.mainEmbedded("Rhino debugger: "+getName());
// this can be too late, depending on when this method is invoked.
Functions.DEBUG_YUI = true;
}
/**
* Returns the last item in the list.
*/