Bug 1039686 - Properly handle unsupported value types in the console. r=robcee, a=sledru
authorPanos Astithas <past@mozilla.com>
Mon, 21 Jul 2014 16:06:02 +0300
changeset 217238 b452f0ac8a41b8241c8c428eb55679ece48f8680
parent 217237 a1267a2ab369b6cdf8426befc8525ad1fc890090
child 217239 91e719c1469037668c96d0341f568aff4b66d2c2
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrobcee, sledru
bugs1039686
milestone33.0a2
Bug 1039686 - Properly handle unsupported value types in the console. r=robcee, a=sledru
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,
     };
   },
 
   /**