Closed Bug 1340935 Opened 8 years ago Closed 8 years ago

Stop using fixIterator

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: arai, Unassigned)

References

Details

fixIterator in iteratorUtils.jsm contains __iterator__ and legacy generator, and does so much tricky things. most of its functionality should be able to be replaced with more fundamental API, and other complicated things should have its own function name, separated from others. also, consumers should use for-of instead of for-in.
https://dxr.mozilla.org/comm-central/rev/567601fc64d9e8cd4f2e417cf35d90d4cc48140f/mail/components/compose/content/MsgComposeCommands.js#4069-4075 > Anything iterable with fixIterator is accepted. it sounds like it's not a realistic plan. I'll choose easier way to remove __iterator__ and legacy generator from it, maybe just remove __iterator__ from it and use for-of in consumers.
Assignee: arai.unmht → nobody
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
We want to keep fixIterator that hides what type of array/iterable object is being used. It should not be replaced by opencoding a loop for specific array type. But converting fixIterator to a proper 'new' generator is a good plan and also fixing the callers to use for..of is fine. But surely there are addons doing for..in...
You need to log in before you can comment on or make changes to this bug.