Closed Bug 1319939 Opened 8 years ago Closed 8 years ago

Remove String generics uses in toolkit/mozapps/extensions/content

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: anba, Assigned: anba)

References

Details

(Whiteboard: triaged)

Attachments

(1 file, 1 obsolete file)

The various String generic methods are non-standard APIs and we plan to warn when they're used (bug 1319926) and eventually want to remove them completely (bug 1222552). As a first step we need to replace all String generic uses in Firefox with the counterpart from String.prototype. In toolkit/mozapps/extensions/content/blocklist.js and toolkit/mozapps/extensions/content/extensions.js, String.localeCompare needs to be replaced with a call to String.prototype.localeCompare.
Attached patch bug1319939.patch (obsolete) (deleted) — Splinter Review
Attachment #8814233 - Flags: review?(rhelmer)
Comment on attachment 8814233 [details] [diff] [review] bug1319939.patch Review of attachment 8814233 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: toolkit/mozapps/extensions/content/blocklist.js @@ +27,5 @@ > bundle.GetStringFromName("restartLaterButton.accesskey")); > > var richlist = document.getElementById("addonList"); > var list = gArgs.list; > + list.sort(function(a, b) { return String(a.name).localeCompare(b.name); }); nit: this could be an arrow function w/ concise body if you want
Attachment #8814233 - Flags: review?(rhelmer) → review+
Whiteboard: triaged
Attached patch bug1319939.patch (deleted) — Splinter Review
Updated patch to replace the function expression with an arrow function per review comments. Carrying r+ from rhelmer.
Attachment #8814233 - Attachment is obsolete: true
Attachment #8815481 - Flags: review+
(In reply to Robert Helmer [:rhelmer] from comment #2) > Thanks! Thanks for reviewing!
Keywords: checkin-needed
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/5897fbfa16c9 Remove String generics uses in toolkit/mozapps/extensions/content. r=rhelmer
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: