Closed
Bug 1319938
Opened 8 years ago
Closed 8 years ago
Remove String generics uses in toolkit/components/extensions
Categories
(WebExtensions :: General, defect, P3)
WebExtensions
General
Tracking
(firefox53 fixed)
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: anba, Assigned: anba)
References
Details
(Whiteboard: triaged)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
aswan
:
review+
|
Details | Diff | Splinter Review |
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/components/extensions/Extension.jsm, String.replace needs to be replaced with a call to String.prototype.replace.
Assignee | ||
Comment 1•8 years ago
|
||
Attachment #8814232 -
Flags: review?(aswan)
Comment 2•8 years ago
|
||
Comment on attachment 8814232 [details] [diff] [review]
bug1319938.patch
Review of attachment 8814232 [details] [diff] [review]:
-----------------------------------------------------------------
I think in both of those cases we expect the first argument to already be a string. I'm not sure why the code was originally written in that way but looking forward, getting to either of those cases with something other than a string indicates a programming error somewhere else and should raise an exception. Or in other words, can you remove the explicit call to the string constructor and just invoke the methods directly?
Updated•8 years ago
|
Priority: -- → P3
Whiteboard: triaged
Comment 3•8 years ago
|
||
(In reply to Andrew Swan [:aswan] from comment #2)
> Comment on attachment 8814232 [details] [diff] [review]
> bug1319938.patch
>
> Review of attachment 8814232 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I think in both of those cases we expect the first argument to already be a
> string. I'm not sure why the code was originally written in that way but
> looking forward, getting to either of those cases with something other than
> a string indicates a programming error somewhere else and should raise an
> exception. Or in other words, can you remove the explicit call to the
> string constructor and just invoke the methods directly?
We can, yes.
Assignee | ||
Comment 4•8 years ago
|
||
Updated patch to remove the explicit call to `String`.
Attachment #8814232 -
Attachment is obsolete: true
Attachment #8814232 -
Flags: review?(aswan)
Attachment #8815480 -
Flags: review?(aswan)
Updated•8 years ago
|
Attachment #8815480 -
Flags: review?(aswan) → review+
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a42ceecb2260
Remove String generics uses in toolkit/components/extensions. r=aswan
Keywords: checkin-needed
Comment 7•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•6 years ago
|
Product: Toolkit → WebExtensions
You need to log in
before you can comment on or make changes to this bug.
Description
•