Bug 719292 - Error: hud.jsterm is null in resource:///modules/HUDService.jsm:2074; r=msucan
authorJoe Walker <jwalker@mozilla.com>
Fri, 27 Jan 2012 13:42:05 +0000
changeset 86786 a5d23f7e5cb56cb7350fd6223d22cec3ab1386be
parent 86785 50250bac846bfd658847dc822e57f20b970b5f81
child 86787 5e41076a67dd41640e18138d9a923da97fd258aa
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmsucan
bugs719292
milestone12.0a1
Bug 719292 - Error: hud.jsterm is null in resource:///modules/HUDService.jsm:2074; r=msucan
browser/devtools/webconsole/HUDService.jsm
--- a/browser/devtools/webconsole/HUDService.jsm
+++ b/browser/devtools/webconsole/HUDService.jsm
@@ -2062,17 +2062,26 @@ HUD_SERVICE.prototype =
    *        The message reported by the console service.
    * @return void
    */
   logConsoleAPIMessage: function HS_logConsoleAPIMessage(aHUDId, aMessage)
   {
     // Pipe the message to createMessageNode().
     let hud = HUDService.hudReferences[aHUDId];
     function formatResult(x) {
-      return (typeof(x) == "string") ? x : hud.jsterm.formatResult(x);
+      if (typeof(x) == "string") {
+        return x;
+      }
+      if (hud.gcliterm) {
+        return hud.gcliterm.formatResult(x);
+      }
+      if (hud.jsterm) {
+        return hud.jsterm.formatResult(x);
+      }
+      return x;
     }
 
     let body = null;
     let clipboardText = null;
     let sourceURL = null;
     let sourceLine = 0;
     let level = aMessage.level;
     let args = aMessage.arguments;
@@ -7063,10 +7072,13 @@ GcliTerm.prototype = {
                     aOptions.sourceUrl || undefined,
                     aOptions.sourceLine || undefined,
                     aOptions.clipboardText || undefined);
 
     ConsoleUtils.outputMessageNode(node, this.hudId);
   },
 
   clearOutput: JSTerm.prototype.clearOutput,
+
+  formatResult: JSTerm.prototype.formatResult,
+  getResultType: JSTerm.prototype.getResultType,
+  formatString: JSTerm.prototype.formatString,
 };
-