Closed
Bug 1074804
Opened 10 years ago
Closed 9 years ago
Replace arrays .indexOf with .includes in Places
Categories
(Toolkit :: Places, defect, P4)
Toolkit
Places
Tracking
()
RESOLVED
FIXED
mozilla44
Tracking | Status | |
---|---|---|
firefox44 | --- | fixed |
People
(Reporter: mak, Assigned: hassenbtn, Mentored)
References
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 21 obsolete files)
We can replace instances of .indexOf() with .contains like:
array.indexOf(something) == -1 => !array.contains(something)
array.indexOf(something) != -1 => array.contains(something)
This is the query pointing at the code points that can be changed:
http://mxr.mozilla.org/mozilla-central/search?string=indexOf\(%23\)+%23%3D+\-\1®exp=1&find=places&findi=&filter=^[^\0]*%24
Would be nice to have 1 patch per subfolder, so one patch for /browser/components/places/content/, one for /browser/components/places/tests/ and so on.
Reporter | ||
Comment 1•10 years ago
|
||
before doing this we must be sure bug 1069063 will stick into the tree.
Comment 2•10 years ago
|
||
Hey. i would like to work on this bug. First time here so how do i submit patches ??
Comment 3•10 years ago
|
||
(In reply to Marco Bonardo [::mak] (needinfo? me) from comment #1)
> before doing this we must be sure bug 1069063 will stick into the tree.
Apparently, that's not the case (see Till's recent message to firefox-dev).
Reporter | ||
Comment 4•10 years ago
|
||
yeah sorry, we cannot do this bug for now, we must wait for .contains to be available again.
Whiteboard: [good first bug][lang=js] → [good first bug][lang=js][cannot be fixed until bug 1070767 is fixed]
Comment 5•10 years ago
|
||
ok i found out how to submit patches. I'll get back to this bug when .contains is available again
Comment 6•10 years ago
|
||
Can i work on this bug now? Has bug 1070767 been fixed?
Comment 7•10 years ago
|
||
(In reply to anirudh.gp from comment #6)
> Can i work on this bug now? Has bug 1070767 been fixed?
Not yet. I have added you in the list of persons watching bug 1070767, so that you can be informed once it is fixed.
Comment 8•10 years ago
|
||
(In reply to David Rajchenbach-Teller [:Yoric] (use "needinfo") from comment #7)
> (In reply to anirudh.gp from comment #6)
> > Can i work on this bug now? Has bug 1070767 been fixed?
>
> Not yet. I have added you in the list of persons watching bug 1070767, so
> that you can be informed once it is fixed.
Ok thanks!
Comment 9•10 years ago
|
||
Can you assign this to me? I'l get on with it as soon as bug 1070767 is fixed
Reporter | ||
Comment 10•10 years ago
|
||
I'm sorry but there's no point in booking bugs, when it will be the time, patches will be welcome, until then there's no reason to assign this to anyone.
I'm sure you can find much interesting bugs that are immediately actionable in the list of mentored bugs: http://www.joshmatthews.net/bugsahoy/?js=1&unowned=1
Reporter | ||
Updated•10 years ago
|
Summary: Replace indexOf with contains in Places → Replace arrays .indexOf with .includes in Places
Comment 11•10 years ago
|
||
Hey. Bug 1070767 has been fixed. Can I be assigned to this bug so that I can work on it ?
Reporter | ||
Comment 12•10 years ago
|
||
most likely yes, I'm trying to figure how stable is the current proposal.
It looks like experimental, for ES7, moving to stage 2 of the process.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes
Looks like we are also changing string.contains to string.includes in bug 1102219, I'd not expect it to change another time, so I guess we can proceed.
Assignee: nobody → anirudh.gp
Reporter | ||
Comment 13•10 years ago
|
||
OK, we can't do this for now cause the feature is Nightly only. We must again wait on Bug 1070767.
Reporter | ||
Updated•9 years ago
|
Priority: -- → P4
Whiteboard: [good first bug][lang=js][cannot be fixed until bug 1070767 is fixed] → [good first bug][lang=js]
Assignee | ||
Comment 14•9 years ago
|
||
anirudh.gp, if you didn't start working on this yet, i'm available from today to work on this, i hope you allow me this [good first bug] :)
Assignee | ||
Comment 15•9 years ago
|
||
Assignee | ||
Comment 16•9 years ago
|
||
Assignee | ||
Comment 17•9 years ago
|
||
Assignee | ||
Comment 18•9 years ago
|
||
Assignee | ||
Comment 19•9 years ago
|
||
Assignee | ||
Comment 20•9 years ago
|
||
Assignee | ||
Comment 21•9 years ago
|
||
Assignee | ||
Comment 22•9 years ago
|
||
Assignee | ||
Comment 23•9 years ago
|
||
Assignee | ||
Comment 24•9 years ago
|
||
Assignee | ||
Comment 25•9 years ago
|
||
Assignee | ||
Comment 26•9 years ago
|
||
Reporter | ||
Comment 27•9 years ago
|
||
from the Try run looks like something is wrong...
Reporter | ||
Comment 28•9 years ago
|
||
by looking at the patches, looks like in some cases you replaced a.indexOf(b) == -1 with a.includes(b), but it should instead be !a.includes(b)
Flags: needinfo?(anirudh.gp)
Assignee | ||
Comment 29•9 years ago
|
||
i ll work on that, i somehow missed that, weird ...
Comment hidden (obsolete) |
Assignee | ||
Comment 31•9 years ago
|
||
ignore that, i thought it would edit the patch so i dont have to resubmit
Reporter | ||
Comment 32•9 years ago
|
||
heh no, you need to edit the patches locally, and submit them again, deprecating the previous version.
With mozReview the process is a little bit more automatized, but then you must also learn how to use it (http://mozilla-version-control-tools.readthedocs.org/en/latest/mozreview-user.html) and you have to move the patches there.
For now I'd suggest to just replace single parts with fixed one.
Note, if you wish to merge all the patches into one, I won't complain in this case, cause the change is mostly automatic.
Reporter | ||
Updated•9 years ago
|
Assignee: anirudh.gp → hassenbtn
Flags: needinfo?(anirudh.gp)
Assignee | ||
Comment 33•9 years ago
|
||
thanks for the tips, that's what i was gonna do, i ll see how to merge them into one patch
Assignee | ||
Comment 34•9 years ago
|
||
Attachment #8669452 -
Attachment is obsolete: true
Assignee | ||
Comment 35•9 years ago
|
||
Assignee | ||
Comment 36•9 years ago
|
||
Attachment #8669453 -
Attachment is obsolete: true
Attachment #8670268 -
Attachment is obsolete: true
Assignee | ||
Comment 37•9 years ago
|
||
Attachment #8669454 -
Attachment is obsolete: true
Assignee | ||
Comment 38•9 years ago
|
||
Attachment #8669455 -
Attachment is obsolete: true
Assignee | ||
Comment 39•9 years ago
|
||
Attachment #8669459 -
Attachment is obsolete: true
Assignee | ||
Comment 40•9 years ago
|
||
Attachment #8669460 -
Attachment is obsolete: true
Assignee | ||
Comment 41•9 years ago
|
||
Attachment #8669462 -
Attachment is obsolete: true
Assignee | ||
Comment 42•9 years ago
|
||
Changed the patches in question.
Not sure how to merge all patches into one without polluting my repo, is it a simple file concatenation?
Reporter | ||
Comment 43•9 years ago
|
||
if you are using mercurial queues, you can use the hg qfold command
Assignee | ||
Comment 44•9 years ago
|
||
Attachment #8669456 -
Attachment is obsolete: true
Attachment #8669457 -
Attachment is obsolete: true
Attachment #8669458 -
Attachment is obsolete: true
Attachment #8669461 -
Attachment is obsolete: true
Attachment #8670267 -
Attachment is obsolete: true
Attachment #8670270 -
Attachment is obsolete: true
Attachment #8670271 -
Attachment is obsolete: true
Attachment #8670272 -
Attachment is obsolete: true
Attachment #8670273 -
Attachment is obsolete: true
Attachment #8670275 -
Attachment is obsolete: true
Attachment #8670276 -
Attachment is obsolete: true
Assignee | ||
Comment 45•9 years ago
|
||
can you push to tryserver for me, i'm not allowed since i'm new.
Assignee | ||
Comment 46•9 years ago
|
||
Reporter | ||
Comment 47•9 years ago
|
||
Comment on attachment 8670397 [details] [diff] [review]
Changes for Bug 1074804 - Replace arrays .indexOf with .includes in Places
Review of attachment 8670397 [details] [diff] [review]:
-----------------------------------------------------------------
Very nice job!
r=me with the following fixes:
Please edit the commit message so that it just reads as:
Bug 1074804 - Replace arrays .indexOf with .includes in Places. r=mak
::: toolkit/components/places/PlacesTransactions.jsm
@@ +1040,5 @@
> }
> if (annos.length > 0) {
> if (!aRestoring && aExcludingAnnotations.length > 0) {
> annos = [for(a of annos)
> + if (!aExcludingAnnotations.indcludes(a.name)) a];
There is a typo here "indcludes"
Attachment #8670397 -
Flags: review+
Reporter | ||
Comment 48•9 years ago
|
||
please, when updating the patch, also ensure it applies on top of a current and updated tree, otherwise our sheriffs won't be able to land it.
Assignee | ||
Comment 49•9 years ago
|
||
thanks, i ll do that and upload again! thanks for the tips!
Assignee | ||
Comment 50•9 years ago
|
||
Not really sure if i did what you asked in the last comment, so what i did is update my local repo, then apply the patch.
Attachment #8670397 -
Attachment is obsolete: true
Assignee | ||
Comment 51•9 years ago
|
||
sorry wrong previous file
Attachment #8671507 -
Attachment is obsolete: true
Reporter | ||
Comment 52•9 years ago
|
||
(In reply to Hassen ben tanfous from comment #50)
> Created attachment 8671507 [details] [diff] [review]
> Bug 1074804 - Replace arrays .indexOf with .includes in Places. r=mak
>
> Not really sure if i did what you asked in the last comment, so what i did
> is update my local repo, then apply the patch.
Yep, it's fine.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b5ed9915862b
Keywords: checkin-needed
Comment 53•9 years ago
|
||
Keywords: checkin-needed
Comment 54•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•