Closed Bug 577387 Opened 14 years ago Closed 14 years ago

remove iQ.each

Categories

(Firefox Graveyard :: Panorama, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mitcho, Assigned: mitcho)

Details

(Whiteboard: tracked)

iQ.each is unnecessary and should be removed, and all uses of it should be rewritten using Array.forEach().

For why we are not using { for each (... in ...) } notation, see https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Statements/for...in#Description
Just making sure, when you say Array.forEach, you actually mean [].forEach, yeah? Or is this for node lists and such, so you'll need to Array.forEach(list, callback) ?
(In reply to comment #1)
> Just making sure, when you say Array.forEach, you actually mean [].forEach,
> yeah? Or is this for node lists and such, so you'll need to Array.forEach(list,
> callback) ?

Sorry, I did just mean [].forEach . Thanks!
At the very least, for now we should add a log message at the top of iQ.each that prints out a deprecation warning.
FYI: I did a lot of work along these lines today (on .each as well as other methods):

http://hg.mozilla.org/users/edward.lee_engineering.uiuc.edu/tabcandy-central/rev/5d8193161059
Assignee: nobody → mitcho
Status: NEW → ASSIGNED
Done!

http://hg.mozilla.org/users/edward.lee_engineering.uiuc.edu/tabcandy-central/rev/f20e74f100b6
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
FYI, forEach and most other array comprehension functions (except reduce) take a second argument for passing in "this".
Mass moving all Tab Candy bugs from Mozilla Labs to Firefox::Tab Candy.  Filter the bugmail spam with "tabcandymassmove".
Product: Mozilla Labs → Firefox
Target Milestone: -- → ---
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.