Bug 588118 - Web Console error messages display the wrong line number r=sdwilsh a=bloking2.0
authorPatrick Walton <pcwalton@mozilla.com>
Wed, 01 Sep 2010 12:56:10 -0700
changeset 51849 8d82ccccf7ddcca23683caf1bc991e561a7a689d
parent 51848 b6df151f4fe1f89cca389f0fbd5303f98c82e20f
child 51850 b38d6617f160518d014312c1f1cb993c2f180dd4
push id15449
push userddahl@mozilla.com
push dateWed, 01 Sep 2010 19:57:12 +0000
treeherdermozilla-central@8d82ccccf7dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssdwilsh, bloking2
bugs588118
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 588118 - Web Console error messages display the wrong line number r=sdwilsh a=bloking2.0
toolkit/components/console/hudservice/HUDService.jsm
toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js
--- a/toolkit/components/console/hudservice/HUDService.jsm
+++ b/toolkit/components/console/hudservice/HUDService.jsm
@@ -2326,18 +2326,18 @@ HUD_SERVICE.prototype =
     // in this case, the "activity object" is the
     // nsIScriptError or nsIConsoleMessage
     var message = {
       activity: aActivityObject,
       origin: "console-listener",
       hudId: hudId,
     };
 
-    var lineColSubs = [aActivityObject.columnNumber,
-                       aActivityObject.lineNumber];
+    var lineColSubs = [aActivityObject.lineNumber,
+                       aActivityObject.columnNumber];
     var lineCol = this.getFormatStr("errLineCol", lineColSubs);
 
     var errFileSubs = [aActivityObject.sourceName];
     var errFile = this.getFormatStr("errFile", errFileSubs);
 
     var msgCategory = this.getStr("msgCategory");
 
     message.logLevel = logLevel;
--- a/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js
+++ b/toolkit/components/console/hudservice/tests/browser/browser_HUDServiceTestsAll.js
@@ -1204,23 +1204,29 @@ function testErrorOnPageReload() {
         return;
       }
 
       Services.console.unregisterListener(this);
 
       const successMsg = "Found the error message after page reload";
       const errMsg = "Could not get the error message after page reload";
 
+      const successMsgErrorLine = "Error line is correct";
+      const errMsgErrorLine = "Error line is incorrect";
+
       var display = HUDService.getDisplayByURISpec(content.location.href);
       var outputNode = display.querySelectorAll(".hud-output-node")[0];
 
       executeSoon(function () {
         testLogEntry(outputNode, "fooBazBaz",
           { success: successMsg, err: errMsg });
 
+        testLogEntry(outputNode, "Line: 14, Column: 0",
+          { success: successMsgErrorLine, err: errMsgErrorLine });
+
         testDuplicateError();
       });
     }
   };
 
   var pageReloaded = false;
   browser.addEventListener("load", function() {
     if (!pageReloaded) {