Bug 1089547: fix error passing in MozLoopAPI and remove leftover in LoopRooms. r=Standard8 a=loop-only
authorMike de Boer <mdeboer@mozilla.com>
Wed, 29 Oct 2014 17:01:26 +0100
changeset 233782 6dca7a6a8f339586c8f6c741323b5254d4ebfd97
parent 233781 b74d6c49038dfeeb3234aad6f9dedb353290c974
child 233783 f634a1289875070bc400531f45b1861a392beace
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersStandard8, loop-only
bugs1089547
milestone35.0a2
Bug 1089547: fix error passing in MozLoopAPI and remove leftover in LoopRooms. r=Standard8 a=loop-only
browser/components/loop/LoopRooms.jsm
browser/components/loop/MozLoopAPI.jsm
--- a/browser/components/loop/LoopRooms.jsm
+++ b/browser/components/loop/LoopRooms.jsm
@@ -83,17 +83,16 @@ let LoopRoomsInternal = {
       let roomsList = JSON.parse(response.body);
       if (!Array.isArray(roomsList)) {
         throw new Error("Missing array of rooms in response.");
       }
 
       // Next, request the detailed information for each room. If the request
       // fails the room data will not be added to the map.
       for (let room of roomsList) {
-        let eventName = this.rooms.has(room.roomToken) ? "update" : "add";
         this.rooms.set(room.roomToken, room);
         yield LoopRooms.promise("get", room.roomToken);
       }
 
       // Set the 'dirty' flag back to FALSE, since the list is as fresh as can be now.
       gDirty = false;
       callback(null, [...this.rooms.values()]);
     }.bind(this)).catch(error => {
--- a/browser/components/loop/MozLoopAPI.jsm
+++ b/browser/components/loop/MozLoopAPI.jsm
@@ -72,17 +72,17 @@ const cloneErrorObject = function(error,
  */
 const cloneValueInto = function(value, targetWindow) {
   if (!value || typeof value != "object") {
     return value;
   }
 
   // Strip Function properties, since they can not be cloned across boundaries
   // like this.
-  for (let prop of value) {
+  for (let prop of Object.getOwnPropertyNames(value)) {
     if (typeof value[prop] == "function") {
       delete value[prop];
     }
   }
 
   // Inspect for an error this way, because the Error object is special.
   if (value.constructor.name == "Error") {
     return cloneErrorObject(value, targetWindow);