Closed
Bug 1302582
Opened 8 years ago
Closed 8 years ago
Add explicit JS_ReportError*ASCII variants
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla52
People
(Reporter: arai, Assigned: arai)
References
Details
Attachments
(1 file, 1 obsolete file)
10.41 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•8 years ago
|
||
Added ASCII variants. they forward to UTF8 variants. the forwarding part is simple, but the validation part is somewhat tricky, as we have multiple parameters, and some of them may be non-string for JS_ReportErrorASCII and JS_ReportWarningASCII cases. maybe we'd better adding actual ASCII variants, that asserts after formatting in ReportErrorVA or ExpandErrorArgumentsVA. how do you think?
Attachment #8791018 -
Flags: review?(jwalden+bmo)
Comment 2•8 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #1) > maybe we'd better adding actual ASCII variants, that asserts after > formatting in ReportErrorVA or ExpandErrorArgumentsVA. Hmm, it does seem like it'd be worth pushing the asserting into the when-splatting-each-argument code. Having an extra allocation/possibility to OOM in order to format the entire string, to verify this, is unideal. I don't believe *technically* there's any reason the formatter callback can't be impure -- and this would add a reason, and IMO not really a super-great one. So I guess this really wants a JS::detail::Report8Bit(cx, ..., enum { ArgumentsAreASCII, ArgumentsAreUTF8 }) that both would call, I think. Shouldn't quite be forwarding from the ASCII function to the UTF-8 one, as I was initially thinking.
Updated•8 years ago
|
Attachment #8791018 -
Flags: review?(jwalden+bmo)
Assignee | ||
Comment 3•8 years ago
|
||
Thanks :) Changed it to just a copy of other variants, with ASCII, and added assertion.
Assignee: nobody → arai.unmht
Attachment #8791018 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8793057 -
Flags: review?(jwalden+bmo)
Comment 4•8 years ago
|
||
Comment on attachment 8793057 [details] [diff] [review] Add JS_ReportError*ASCII variants. Review of attachment 8793057 [details] [diff] [review]: ----------------------------------------------------------------- ::: js/src/jscntxt.cpp @@ +317,5 @@ > return false; > } > > +#ifdef DEBUG > +static inline void We probably don't want inline, if all callers ever die.
Attachment #8793057 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 5•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d028babfbb85dcb1ba021c78ea2b60042c6c86d8 Bug 1302582 - Add JS_ReportError*ASCII variants. r=jwalden
Comment 6•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d028babfbb85
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment 7•8 years ago
|
||
Mark 51 as won't fix. If it's worth uplifting to 51, feel free to nominate it.
You need to log in
before you can comment on or make changes to this bug.
Description
•