Convert ThrowTypeError/ThrowRangeError to the new JS_ReportErrorNumberUTF8Array API
Categories
(Core :: DOM: Bindings (WebIDL), task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | fixed |
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
Attachments
(6 files)
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review | |
|
47 bytes,
text/x-phabricator-request
|
Details | Review |
Once bug 1619087 lands we can use that API and store nsCString instead of nsString in the typeerror/rangeerror cases in ErrorResult. Then we can easily remove the u"" bits at callsites, just using "" string literals. We'll need to do some cleanup to deal with the actual nsAStrings that are being passed in. Worst case, we can implement dom::StringArrayAppender::Append for nsAString to do a conversion to UTF-8 (which the JS engine is doing anyway right now, by the way, when we throw the exception) and then find callsites and change them if possible one by one....
| Assignee | ||
Comment 1•6 years ago
|
||
CStringArrayAppender is just a copy of StringArrayAppender with the incoming
types expanded to accept both wide and narrow strings. Later patches will
remove the wide-string variants incrementally.
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
| Assignee | ||
Comment 3•6 years ago
|
||
| Assignee | ||
Comment 4•6 years ago
|
||
| Assignee | ||
Comment 5•6 years ago
|
||
Callers should pass in UTF-8, since that's what the JS engine ends up with in the end anyway.
The various URL changes are because NS_NewURI converts incoming nsAString to
UTF-8 anyway. So we might as well do that up-front and then use the UTF-8
string for both the NS_NewURI call and the error-reporting if it fails.
| Assignee | ||
Comment 6•6 years ago
|
||
Comment 8•6 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d0caab4d75ad
https://hg.mozilla.org/mozilla-central/rev/5006a4d63a02
https://hg.mozilla.org/mozilla-central/rev/572c7a308bdb
https://hg.mozilla.org/mozilla-central/rev/b534dbd8363d
https://hg.mozilla.org/mozilla-central/rev/6c096ce0e3e6
https://hg.mozilla.org/mozilla-central/rev/29ad47d40718
Description
•