Closed Bug 1161530 Opened 10 years ago Closed 10 years ago

[Messages][Refactoring] Remove deprecated String.prototype.contains usages

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1166863

People

(Reporter: azasypkin, Unassigned, Mentored)

References

Details

(Whiteboard: [lang=js][good first bug][sms-papercuts])

In bug 1102219 "String.prototype.contains" was renamed to "String.prototype.includes" (see the reason behind this in [1]). Currently I see that we use this method only in "contacts.js" and in a number of unit tests. So in this bug we just need to replace "String.prototype.contains" calls with "String.prototype.includes" everywhere we use it. E.g. see [2] and [3]. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes [2] https://github.com/mozilla-b2g/gaia/blob/42dc5f02a9df006b129824cd9bffa93cab937ab2/apps/sms/js/contacts.js#L12 [3] https://github.com/mozilla-b2g/gaia/blob/42dc5f02a9df006b129824cd9bffa93cab937ab2/apps/sms/js/contacts.js#L237
Hi there, I would like to work on this bug. It would be my first contribution ever, and this seems pretty easy. It it really just as easy as: - replacing 'return a.contains(b);' with 'return a.includes(b);' at line 12, and - replacing 'if (num.contains(filterValue))' with 'if (num.includes(filterValue))' at line 237? I guess I would have to do something similare in the unit tests you mentioned.
Flags: needinfo?(azasypkin)
(In reply to Piervincenzo Parisi [:PierV] from comment #1) > Hi there, I would like to work on this bug. It would be my first > contribution ever, and this seems pretty easy. > > It it really just as easy as: > - replacing 'return a.contains(b);' with 'return a.includes(b);' at line 12, > and > - replacing 'if (num.contains(filterValue))' with 'if > (num.includes(filterValue))' at line 237? > > I guess I would have to do something similare in the unit tests you > mentioned. Great! Yeah, basically it's - just few places in the code (contacts.js) and few more in unit tests. Since it's your first contribution, I'd encourage you to start from reading [1]. If you have have any questions, you can need info me here or just come to our IRC channel (#gaia-messaging). So assigning bug to you then :) Thanks! [1] https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/README.md
Assignee: nobody → piervi_parisi
Flags: needinfo?(azasypkin)
Hey Piervincenzo, Just wanted to check if you're still going to work this bug, it's OK if you don't have time :) It turned out that dupe of this bug was just filed altogether with the patch, so if you haven't started yet we can find another good bug for you :) Thanks and sorry for the noise!
Flags: needinfo?(piervi_parisi)
Hi there! I've had some trouble with the Ubuntu machine so actually I didn't exactly started working on this yet; no problem at all, then. We can definitely find something else to work on! ;)
Flags: needinfo?(piervi_parisi)
Cool, thanks! You can always use http://www.joshmatthews.net/bugsahoy/ to find bugs that may be interesting for you or ping me directly.
Assignee: piervi_parisi → nobody
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.