If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Remove `for each` usage from Add-on SDK documentation example

RESOLVED FIXED

Status

Add-on SDK
Documentation
P3
normal
RESOLVED FIXED
5 years ago
3 years ago

People

(Reporter: zer0, Assigned: Alan)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
The `for each` statement is considered deprecated (see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Statements/for_each...in), we should stop to use it our documentation.
(Reporter)

Updated

5 years ago
Depends on: 865489

Updated

5 years ago
Priority: -- → P3
(Reporter)

Comment 1

4 years ago
As Irakli noted here:

https://github.com/mozilla/addon-sdk/pull/986#issuecomment-17865084

We should also recomend `for…of` in our docs.
Whiteboard: [good first bug]
http://mxr.mozilla.org/mozilla-central/search?string=for+each%28&find=%2Faddon-sdk%2F&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central

http://mxr.mozilla.org/mozilla-central/search?string=for+each+%28&find=%2Faddon-sdk%2F&findi=&filter=^[^\0]*%24&hitlimit=&tree=mozilla-central

These two searches should list all of the instances of for each in the SDK codebase. This probably crosses over with what bug 866733 would fix.
(Assignee)

Comment 3

3 years ago
I would like to attempt this as my first bug.

Comment 4

3 years ago
Hey Alan, are you working on this one?
(In reply to Alan from comment #3)
> I would like to attempt this as my first bug.
(Assignee)

Comment 5

3 years ago
(In reply to yt from comment #4)
> Hey Alan, are you working on this one?
> (In reply to Alan from comment #3)
> > I would like to attempt this as my first bug.

No, I was not assigned. Feel free to work on it :).

Comment 6

3 years ago
(In reply to Alan from comment #5)
> No, I was not assigned. Feel free to work on it :).

Hey, I don't think you need to be assigned to it to work on it. In fact, I was under the impression that first-timers needed to submit something before a bug gets assigned to them. Go ahead and work on it if you want! If you don't want to, I'll check into it, but you should. I'm a beginner myself so I can't mentor you or anything but I've worked on a couple sdk bugs so if you wanna chat email me or look me up in irc (yt). 
Also, if you'd like a mentor just ask for one or flag 'need more info' at the bottom and someone will help.
(Assignee)

Comment 7

3 years ago
Cool, thanks for the insight! I asked someone on irc about this and I didn't really got an answer as to how the system works. I just assume that I was on hold, and forgot about it.

Regardless, I will work on this and should get it done in a couple of days.
(In reply to yt from comment #6)
> (In reply to Alan from comment #5)
> > No, I was not assigned. Feel free to work on it :).
> 
> Hey, I don't think you need to be assigned to it to work on it. In fact, I
> was under the impression that first-timers needed to submit something before
> a bug gets assigned to them. Go ahead and work on it if you want! If you
> don't want to, I'll check into it, but you should. I'm a beginner myself so
> I can't mentor you or anything but I've worked on a couple sdk bugs so if
> you wanna chat email me or look me up in irc (yt). 
> Also, if you'd like a mentor just ask for one or flag 'need more info' at
> the bottom and someone will help.
(Assignee)

Comment 8

3 years ago
I made changes to the following MDN pages:

https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/tabs
https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/windows
https://developer.mozilla.org/en-US/Add-ons/SDK/High-Level_APIs/page-mod
https://developer.mozilla.org/en-US/Add-ons/SDK/Tutorials/List_Open_Tabs

I found these pages by searching on Google with:

site:developer.mozilla.org inurl:sdk for each var

It's possible that I missed some pages. If I did, please tell me.
Flags: needinfo?(zer0)
(Reporter)

Comment 9

3 years ago
Alan, this looks good to me.
Will, do you know in case, a way to double check which SDK documentation page in mdn, contains `for each` in the examples, other than Google? Thanks!
Flags: needinfo?(zer0) → needinfo?(wbamberg)
(Reporter)

Comment 10

3 years ago
I also want to point out that thanks to your change, Alan, people learned something new: http://stackoverflow.com/questions/26525695/javascript-of-keyword ;)
(In reply to Matteo Ferretti [:matteo] [:zer0] from comment #9)
> Alan, this looks good to me.
> Will, do you know in case, a way to double check which SDK documentation
> page in mdn, contains `for each` in the examples, other than Google? Thanks!

No - well, MDN has its own search function of course, but I don't know of a better way than search.

(In reply to Matteo Ferretti [:matteo] [:zer0] from comment #10)
> I also want to point out that thanks to your change, Alan, people learned
> something new:
> http://stackoverflow.com/questions/26525695/javascript-of-keyword ;)

Nice!
Flags: needinfo?(wbamberg)
(Reporter)

Comment 12

3 years ago
Then, I'm marking the bug as resolved. Thanks Alan!
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Assignee: nobody → xrsquared
Whiteboard: [good first bug]
You need to log in before you can comment on or make changes to this bug.