The default bug view has changed. See this FAQ.

remove support of nsIEnumerator from mailnews/base/util/iteratorUtils.jsm

RESOLVED FIXED in Thunderbird 21.0

Status

MailNews Core
Backend
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: aceman, Assigned: aceman)

Tracking

({addon-compat})

Trunk
Thunderbird 21.0
addon-compat
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
+++ This bug was initially created as a clone of Bug #834020 +++

nsIEnumerator seems obsolete per https://developer.mozilla.org/en-US/docs/XPCOM_array_guide.

I think can remove the support from mailnews/base/util/iteratorUtils.jsm
when the nsISupportsArray is killed from comm-central and mozilla-central.
As the the users of these arrays can call .enumerate() them and that that produces an nsIEnumerator that the user may want to iterate on.

Of course nsIEnumerator must be killed first too, but that is done for c-c in bug 834020. We must wait for m-c now, in bug 7795.
(Assignee)

Updated

4 years ago
Summary: remove support of nsIEnumerator mailnews/base/util/iteratorUtils.jsm → remove support of nsIEnumerator from mailnews/base/util/iteratorUtils.jsm

Comment 1

4 years ago
I wouldn't have expected people to use iteratorUtils on core enumerators. There are only a few:

nsISelectionPrivate::GetEnumerator
nsICollection::Enumerate
nsIInterfaceInfoManager has two
PSM has three.

I'm not even sure you can count nsICollection::Emumerate because you can use iteratorUtils on an nsISupportsArray directly.
(Assignee)

Comment 2

4 years ago
I'm thinking of this stuff:
mailnews:
db/gloda/modules/index_msg.js:              for each (let destMsgHdr in fixIterator(aDestMsgHdrs.enumerate(),
db/gloda/modules/index_msg.js:              for each (let srcMsgHdr in fixIterator(aSrcMsgHdrs.enumerate(),
db/gloda/modules/index_msg.js:            for each (let destMsgHdr in fixIterator(aDestMsgHdrs.enumerate(),
test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aMsgs.enumerate(),
test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aMsgs.enumerate(),
test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aSrcMsgs.enumerate(),
test/resources/folderEventLogHelper.js:      for each (let msgHdr in fixIterator(aDestMsgs.enumerate(),

mail:
base/content/folderPane.js:        for each (let folderWithFlag in fixIterator(foldersWithFlag.enumerate(),
base/content/editContactOverlay.js:        for (let card in fixIterator(list.addressLists.enumerate())) {
base/modules/MailUtils.js:    for each (let folder in fixIterator(folders.enumerate(), Ci.nsIMsgFolder)) {
components/cloudfile/cloudFileAccounts.js:    for (let entry in fixIterator(categoryManager.enumerateCategory(CATEGORY),
test/mozmill/cloudfile/test-cloudfile-add-account-dialog.js:  for (let entry in fixIterator(gCategoryMan.enumerateCategory(kCategory),

Couldn't find any in suite.
(Assignee)

Comment 3

4 years ago
If we rewrite or audit these places we could probably remove it. With the decision that people having some nsISupportsArray or nsIEnumerator got from m-c code simply must cope with it without fixIterator.

Comment 4

4 years ago
(In reply to aceman from comment #2)
> db/gloda/modules/index_msg.js:              for each (let destMsgHdr in fixIterator(aDestMsgHdrs.enumerate(),
> db/gloda/modules/index_msg.js:              for each (let srcMsgHdr in fixIterator(aSrcMsgHdrs.enumerate(),
> db/gloda/modules/index_msg.js:            for each (let destMsgHdr in fixIterator(aDestMsgHdrs.enumerate(),
> test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aMsgs.enumerate(),
> test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aMsgs.enumerate(),
> test/resources/folderEventLogHelper.js:    for each (let msgHdr in fixIterator(aSrcMsgs.enumerate(),
> test/resources/folderEventLogHelper.js:      for each (let msgHdr in fixIterator(aDestMsgs.enumerate(),
> base/content/folderPane.js:        for each (let folderWithFlag in fixIterator(foldersWithFlag.enumerate(),
> base/content/editContactOverlay.js:        for (let card in fixIterator(list.addressLists.enumerate())) {
> base/modules/MailUtils.js:    for each (let folder in fixIterator(folders.enumerate(), Ci.nsIMsgFolder)) {
fixIterator works on an nsISupportsArray, no need to call .enumerate() on it first. So if you fix those you can go ahead and remove the support in fixIterator for nsIEnumerator!

> components/cloudfile/cloudFileAccounts.js:    for (let entry in fixIterator(categoryManager.enumerateCategory(CATEGORY),
> test/mozmill/cloudfile/test-cloudfile-add-account-dialog.js:  for (let entry in fixIterator(gCategoryMan.enumerateCategory(kCategory),
Not an nsIEnumerator.
(Assignee)

Comment 5

4 years ago
OK, I can try.
Assignee: nobody → acelists
Depends on: 436089
No longer depends on: 7795, 394167
(Assignee)

Comment 6

4 years ago
Created attachment 712020 [details] [diff] [review]
patch - mailnews
Attachment #712020 - Flags: review?(neil)
(Assignee)

Comment 7

4 years ago
Created attachment 712021 [details] [diff] [review]
patch - TB
Attachment #712021 - Flags: review?(mkmelin+mozilla)
(Assignee)

Updated

4 years ago
Status: NEW → ASSIGNED
Keywords: addon-compat

Comment 8

4 years ago
Comment on attachment 712020 [details] [diff] [review]
patch - mailnews

I'm not really familiar with this stuff, maybe mkmelin can review this too?
Attachment #712020 - Flags: review?(neil) → review?(mkmelin+mozilla)
(Assignee)

Updated

4 years ago
Attachment #712020 - Flags: review?(bugmail)
Comment on attachment 712020 [details] [diff] [review]
patch - mailnews

Thanks for fixing the let each to let while you were at it!

This is pretty straightforward, so I think just my review should suffice.
Attachment #712020 - Flags: review?(mkmelin+mozilla)
Attachment #712020 - Flags: review?(bugmail)
Attachment #712020 - Flags: review+
Comment on attachment 712021 [details] [diff] [review]
patch - TB

I think I can review this one too; stealing.
Attachment #712021 - Flags: review?(mkmelin+mozilla) → review+
(Assignee)

Comment 11

4 years ago
Thanks.
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/baabd0228d41
https://hg.mozilla.org/comm-central/rev/b66b5fafc36d
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 21.0
You need to log in before you can comment on or make changes to this bug.