Bug 977013 - TelemetryTimestamps.jsm should use Cu.cloneInto() rather than JSON.stringify/parse r=yoric
authorTim Taubert <ttaubert@mozilla.com>
Wed, 26 Feb 2014 11:55:40 +0100
changeset 171088 dff147791e987c96fbe9e5ab1c4e0235860f273d
parent 171087 31c7e33029b1ad9fdbfc063e27342c2c174cd4d5
child 171089 4572f97a634e0cc30eafc50c365c6f81331ae4eb
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersyoric
bugs977013
milestone30.0a1
Bug 977013 - TelemetryTimestamps.jsm should use Cu.cloneInto() rather than JSON.stringify/parse r=yoric
toolkit/modules/TelemetryTimestamps.jsm
--- a/toolkit/modules/TelemetryTimestamps.jsm
+++ b/toolkit/modules/TelemetryTimestamps.jsm
@@ -41,12 +41,12 @@ this.TelemetryTimestamps = {
   },
 
   /**
    * Returns a JS object containing all of the timeStamps as properties (can be
    * easily serialized to JSON). Used by TelemetryPing to retrieve the data
    * to attach to the telemetry submission.
    */
   get: function TT_get() {
-    // Return a copy of the object by passing it through JSON.
-    return JSON.parse(JSON.stringify(timeStamps));
+    // Return a copy of the object.
+    return Cu.cloneInto(timeStamps, {});
   }
 };