Closed Bug 1518536 Opened 5 years ago Closed 3 years ago

Consider dropping iteratorUtils.jsm / fixIterator

Categories

(MailNews Core :: Backend, enhancement)

enhancement
Not set
normal

Tracking

(thunderbird_esr78 wontfix)

RESOLVED FIXED
89 Branch
Tracking Status
thunderbird_esr78 --- wontfix

People

(Reporter: standard8, Assigned: mkmelin)

References

Details

(Keywords: perf)

Attachments

(4 files)

fixIterator is now largely obsolete - arrays, nsISimpleEnumerators, nsIArrays can all be handled with for..of.

toArray(fixIterator(...)) could probably be replaced with [...directory.addressLists.enumerate()]

Hence, it seems like iteratorUtils.jsm should probably be deprecated/removed.

xref the discussion on bug 729069

Aceman loves it ;-)

Flags: needinfo?(acelists)

Yes it was useful in the past so that our code and also addons didn't need to worry about what kind of array/enumerator they got (especially when we changed the object/interface in base TB).
If this can be accomplished with for..of now, then fixIterator may be unneeded.

What about the internal handling of QueryInterface() and queryElementAt(). Do we still need to specify interface for nsIArray elements?

Also, fixIterator returns a generator function so we would need to investigate whether we use that property of it (outside of for..of). And we don't know about addons.

Component: General → Backend
Flags: needinfo?(acelists)
Keywords: addon-compat
OS: Unspecified → All
Product: Thunderbird → MailNews Core
Hardware: Unspecified → All
Version: unspecified → Trunk

We're almost there.

Assignee: nobody → mkmelin+mozilla
See Also: → 1681031, 1583030
Keywords: addon-compatperf
Status: NEW → ASSIGNED

Needs a checkin-needed?
(or is there some phab-based way of doing it?)

Will land it later today.

Keywords: leave-open
Target Milestone: --- → 89 Branch
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/78900bb22fe4
remove most of iteratorUtils.jsm usage. r=benc

There's now only a few cases left, which need .idl adjustments (I think) before they can be addressed.

Bug 1685484 would fix some, it seems.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/72373036e9cf
Remove redundant fixIterator use in MsgComposeCommands. r=mkmelin
https://hg.mozilla.org/comm-central/rev/1c635a22ed37
Use JS arrays rather than nsIArray in attachment-* event payloads. r=mkmelin

Depends on D112663

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/12bc6e1f0064
Remove iteratorUtils.jsm. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: