Properly handle unsupported value types in the console (bug 1039686). r=robcee
authorPanos Astithas <past@mozilla.com>
Mon, 21 Jul 2014 16:06:02 +0300
changeset 195362 cebc0f24e83973a8232422e6c8d6d74a41a55acc
parent 195361 0859e0ab393418a461522898b70a210ef81ffc7a
child 195363 7ff31c7b215e102c61340eb3af71dadc002afab5
push id46575
push userkwierso@gmail.com
push dateTue, 22 Jul 2014 00:35:21 +0000
treeherdermozilla-inbound@fee5c4bdd713 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobcee
bugs1039686
milestone33.0a1
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
Properly handle unsupported value types in the console (bug 1039686). r=robcee
toolkit/devtools/server/actors/webconsole.js
--- a/toolkit/devtools/server/actors/webconsole.js
+++ b/toolkit/devtools/server/actors/webconsole.js
@@ -745,20 +745,29 @@ WebConsoleActor.prototype =
         let errorToString = evalInfo.window
                             .evalInGlobalWithBindings("ex + ''", {ex: error});
         if (errorToString && typeof errorToString.return == "string") {
           errorMessage = errorToString.return;
         }
       }
     }
 
+    // If a value is encountered that the debugger server doesn't support yet,
+    // the console should remain functional.
+    let resultGrip;
+    try {
+      resultGrip = this.createValueGrip(result);
+    } catch (e) {
+      errorMessage = e;
+    }
+
     return {
       from: this.actorID,
       input: input,
-      result: this.createValueGrip(result),
+      result: resultGrip,
       timestamp: timestamp,
       exception: errorGrip,
       exceptionMessage: errorMessage,
       helperResult: helperResult,
     };
   },
 
   /**