Bug 834911 - Remove support of nsIEnumerator from mailnews/base/util/iteratorUtils.jsm - adapt /mail. r=asuth
authoraceman <acelists@atlas.sk>
Sat, 09 Feb 2013 16:31:30 -0500
changeset 14839 b66b5fafc36d265a58475ad9fc5e8c620d7ca169
parent 14838 baabd0228d4167688c896ce269eb2bba8588dcb4
child 14840 aeb1127152ac457aef2ec6484c5a177f9d34358d
push id867
push userbugzilla@standard8.plus.com
push dateMon, 01 Apr 2013 20:44:27 +0000
treeherdercomm-beta@797726b8d244 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs834911
Bug 834911 - Remove support of nsIEnumerator from mailnews/base/util/iteratorUtils.jsm - adapt /mail. r=asuth
mail/base/content/editContactOverlay.js
mail/base/content/folderDisplay.js
mail/base/content/folderPane.js
mail/base/modules/MailUtils.js
--- a/mail/base/content/editContactOverlay.js
+++ b/mail/base/content/editContactOverlay.js
@@ -141,17 +141,17 @@ var editContactInlineUI = {
       // to be in the address book they belong to.
       let mailingLists = this._cardDetails.book.childNodes;
       while (mailingLists.hasMoreElements() && !inMailList) {
         let list = mailingLists.getNext();
         if (!(list instanceof Components.interfaces.nsIAbDirectory) ||
             !list.isMailList)
           continue;
 
-        for (let card in fixIterator(list.addressLists.enumerate())) {
+        for (let card in fixIterator(list.addressLists)) {
           if (card instanceof Components.interfaces.nsIAbCard &&
               card.primaryEmail == this._cardDetails.card.primaryEmail) {
             inMailList = true;
             break;
           }
         }
       }
     }
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -1983,19 +1983,19 @@ FolderDisplayWidget.prototype = {
    *     If there are no selected messages, the result is an empty list.
    */
   get selectedMessages() {
     if (!this.view.dbView)
       return [];
     // getMsgHdrsForSelection returns an nsIMutableArray.  We want our callers
     //  to have a user-friendly JS array and not have to worry about
     //  QueryInterfacing the values (or needing to know to use fixIterator).
-    return [msgHdr for each
+    return [msgHdr for
               (msgHdr in fixIterator(
-                          this.view.dbView.getMsgHdrsForSelection().enumerate(),
+                          this.view.dbView.getMsgHdrsForSelection(),
                           Components.interfaces.nsIMsgDBHdr))];
   },
 
   /**
    * @return a list of the URIs for the currently selected messages or null
    *     (instead of a list) if there are no selected messages.  Do not
    *     pass around URIs unless you have a good reason.  Legacy code is an
    *     ok reason.
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -914,18 +914,18 @@ let gFolderTreeView = {
   },
 
   _allFoldersWithFlag: function ftv_getAllFolders(accounts, aFolderFlag, deep)
   {
     let folders = [];
     for each (let acct in accounts) {
       let foldersWithFlag = acct.incomingServer.rootFolder.getFoldersWithFlags(aFolderFlag);
       if (foldersWithFlag.length > 0) {
-        for each (let folderWithFlag in fixIterator(foldersWithFlag.enumerate(),
-                                                Components.interfaces.nsIMsgFolder)) {
+        for (let folderWithFlag in fixIterator(foldersWithFlag,
+                                               Components.interfaces.nsIMsgFolder)) {
           folders.push(folderWithFlag);
           // Add sub-folders of Sent and Archive to the result.
           if (deep && (aFolderFlag & (nsMsgFolderFlags.SentMail | nsMsgFolderFlags.Archive)))
             this.addSubFolders(folderWithFlag, folders);
         }
       }
     }
     return folders;
--- a/mail/base/modules/MailUtils.js
+++ b/mail/base/modules/MailUtils.js
@@ -54,17 +54,17 @@ var MailUtils =
    *          isn't found
    */
   getFolderForFileInProfile:
       function MailUtils_getFolderForFileInProfile(aFile) {
     let accountManager = Cc["@mozilla.org/messenger/account-manager;1"]
                            .getService(Ci.nsIMsgAccountManager);
     let folders = accountManager.allFolders;
 
-    for each (let folder in fixIterator(folders.enumerate(), Ci.nsIMsgFolder)) {
+    for (let folder in fixIterator(folders, Ci.nsIMsgFolder)) {
       if (folder.filePath.equals(aFile))
         return folder;
     }
     return null;
   },
 
   /**
    * Get the nsIMsgFolder corresponding to this URI. This uses the RDF service