Bug 1293005 - Replace in-tree consumer of non-standard Iterator() with Object.{values,entries} in im/ in comm-central. r=aleth
authorAman Dwivedi <dwivedi.aman96@gmail.com>
Tue, 03 Jan 2017 16:46:34 +0530
changeset 20979 eef804a8d9cf40c678c1d14c186ec6e9c913818a
parent 20978 d16104cb778d72d07bdb978d9fb194a623d29aee
child 20980 97a86c21e6c33e5dbee5ce3045d9f4138d2260e2
push id12724
push usermozilla@jorgk.com
push dateSun, 08 Jan 2017 08:25:21 +0000
treeherdercomm-central@eef804a8d9cf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth
bugs1293005
Bug 1293005 - Replace in-tree consumer of non-standard Iterator() with Object.{values,entries} in im/ in comm-central. r=aleth
im/content/extensions.js
im/content/jsTreeView.js
--- a/im/content/extensions.js
+++ b/im/content/extensions.js
@@ -103,17 +103,17 @@ var addonsRegister = {
         notificationBox.appendNotification(messageString, notificationName,
                                            iconURL,
                                            notificationBox.PRIORITY_WARNING_MEDIUM,
                                            buttons);
       }
       break;
     case "addon-install-failed":
       // XXX TODO This isn't terribly ideal for the multiple failure case
-      for (let [, install] in Iterator(installInfo.installs)) {
+      for (let install of installInfo.installs) {
         let host = ((installInfo.originatingURI instanceof Ci.nsIStandardURL) &&
                     installInfo.originatingURI.host) ||
                    ((install.sourceURI instanceof Ci.nsIStandardURL) &&
                     install.sourceURI.host);
 
         let error = (host || install.error == 0) ?
                      "addonError" : "addonLocalError";
         if (install.error != 0)
@@ -169,17 +169,17 @@ var addonsRegister = {
       } else {
         messageString = extensionsBundle.getString("addonsInstalled");
         buttons = [];
 
         // Calculate the add-on type that is most popular in the list of
         // installs.
         let types = {};
         let bestType = null;
-        for (let [, install] in Iterator(installInfo.installs)) {
+        for (let install of installInfo.installs) {
           if (install.type in types)
             types[install.type]++;
           else
             types[install.type] = 1;
 
           if (!bestType || types[install.type] > types[bestType])
             bestType = install.type;
         }
--- a/im/content/jsTreeView.js
+++ b/im/content/jsTreeView.js
@@ -119,17 +119,17 @@ PROTO_TREE_VIEW.prototype = {
     this._tree = aTree;
   },
 
   recursivelyAddToMap: function jstv_recursivelyAddToMap(aChild, aNewIndex) {
     // When we add sub-children, we're going to need to increase our index
     // for the next add item at our own level.
     let currentCount = this._rowMap.length;
     if (aChild.children.length && aChild.open) {
-      for (let [i, child] in Iterator(this._rowMap[aNewIndex].children)) {
+      for (let [i, child] of Array.from(this._rowMap[aNewIndex].children).entries()) {
         let index = aNewIndex + i + 1;
         this._rowMap.splice(index, 0, child);
         aNewIndex += this.recursivelyAddToMap(child, index);
       }
     }
     return this._rowMap.length - currentCount;
   },