Permalink
Browse files

Issue 5221: Can't debug code made with console of FB 1.9

  regression from r12003
  • Loading branch information...
1 parent 7a0a667 commit 311f59ef10f87d68ddb27478bbdc924b253f50a0 @nightwing nightwing committed Apr 4, 2012
Showing with 13 additions and 5 deletions.
  1. +13 −5 extension/content/firebug/console/commandLineExposed.js
@@ -147,18 +147,17 @@ function createFirebugCommandLine(context, win)
{
try
{
- var line = Components.stack.lineNumber;
- var result = contentView.eval(expr);
+ var result = FirebugEvaluate(expr, contentView);
notifyFirebug([result], "evaluated", "firebugAppendConsole");
}
catch(exc)
{
// change source and line number of exeptions from commandline code
// create new error since properties of nsIXPCException are not modifiable
var shouldModify, isXPCException;
- if (exc.filename == Components.stack.filename)
+ if (exc.filename == evalFileSrc)
shouldModify = isXPCException = true;
- else if(exc.fileName == Components.stack.filename)
+ else if (exc.fileName == evalFileSrc)
shouldModify = true;
if (shouldModify)
@@ -167,7 +166,7 @@ function createFirebugCommandLine(context, win)
result.stack = null;
result.source = expr;
result.message = exc.message;
- result.lineNumber = exc.lineNumber - line;
+ result.lineNumber = exc.lineNumber;
result.fileName = "data:," + encodeURIComponent(expr);
if(!isXPCException)
result.name = exc.name;
@@ -214,6 +213,15 @@ function createFirebugCommandLine(context, win)
return commandLine;
};
+
+// chrome: urls are filtered out by debugger, so we create script with a data url
+// to get eval sequences in location list and 0 error ofsets
+const evalFileSrc = "data:text/javascript,FirebugEvaluate=function(t,w)w.eval(t)";
+var script = document.createElementNS("http://www.w3.org/1999/xhtml", "script")
+script.src = evalFileSrc;
+document.documentElement.appendChild(script);
+
+
// ********************************************************************************************* //
// Registration

0 comments on commit 311f59e

Please sign in to comment.