Bug 982818 - Render String and Number objects correctly. r=vladan
authorIrving Reid <irving@mozilla.com>
Wed, 12 Mar 2014 17:11:03 -0400
changeset 191681 9ba5ff374b3f8ed80f1f37da2779ae112a01ed81
parent 191680 0c36365d4e41740011700a8a6515b20ad5627b0d
child 191682 f547db6d8bc871d0ded1a832d91c62b36cdda7f1
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvladan
bugs982818
milestone30.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
Bug 982818 - Render String and Number objects correctly. r=vladan
toolkit/components/telemetry/TelemetryPing.jsm
toolkit/content/aboutTelemetry.js
--- a/toolkit/components/telemetry/TelemetryPing.jsm
+++ b/toolkit/components/telemetry/TelemetryPing.jsm
@@ -286,23 +286,23 @@ let Impl = {
       }
 
       for (let p in appTimestamps) {
         if (!(p in ret) && appTimestamps[p])
           ret[p] = appTimestamps[p] - si.process;
       }
     }
 
-    ret.startupInterrupted = new Number(Services.startup.interrupted);
+    ret.startupInterrupted = Number(Services.startup.interrupted);
 
     // Update debuggerAttached flag
     let debugService = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
     let isDebuggerAttached = debugService.isDebuggerAttached;
     gWasDebuggerAttached = gWasDebuggerAttached || isDebuggerAttached;
-    ret.debuggerAttached = new Number(gWasDebuggerAttached);
+    ret.debuggerAttached = Number(gWasDebuggerAttached);
 
     ret.js = Cu.getJSEngineTelemetryValue();
 
     let shutdownDuration = Telemetry.lastShutdownDuration;
     if (shutdownDuration)
       ret.shutdownDuration = shutdownDuration;
 
     let failedProfileLockCount = Telemetry.failedProfileLockCount;
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -767,17 +767,18 @@ let KeyValueTable = {
    * Create the table body
    * Tabs & newlines added to cells to make it easier to copy-paste.
    *
    * @param aTable Table element
    * @param aMeasurements Key/value map
    */
   renderBody: function KeyValueTable_renderBody(aTable, aMeasurements) {
     for (let [key, value] of Iterator(aMeasurements)) {
-      if (typeof value == "object") {
+      // use .valueOf() to unbox Number, String, etc. objects
+      if ((typeof value == "object") && (typeof value.valueOf() == "object")) {
         value = RenderObject(value);
       }
 
       let newRow = document.createElement("tr");
       aTable.appendChild(newRow);
 
       let keyField = document.createElement("td");
       keyField.appendChild(document.createTextNode(key + "\t"));