Closed
Bug 757699
Opened 12 years ago
Closed 12 years ago
Simplify the code returning uint32_t to JS via IDL any in the WebGLContext a bit
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: bzbarsky, Assigned: bzbarsky)
Details
Attachments
(1 file)
8.38 KB,
patch
|
bjacob
:
review+
|
Details | Diff | Splinter Review |
I'd missed that JS::NumberValue has a uint32_t overload that will automagically do the right thing in terms of picking double vs int. We should use it here.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #626294 -
Flags: review?(bjacob)
Assignee | ||
Updated•12 years ago
|
Whiteboard: [need review]
Comment 2•12 years ago
|
||
Comment on attachment 626294 [details] [diff] [review] Use JS::NumberValue, not JS::DoubleValue, for returning uint32_t values to JS. Review of attachment 626294 [details] [diff] [review]: ----------------------------------------------------------------- Isn't it unfortunate that you have to cast to uint32_t before passing to JS::NumberValue? If the type of the argument really matters, I would templatize JS::NumberValue in the type of its argument, so that JS::NumberValue(x) would find its type by template-argument-deduction and could then automatically do the right thing.
Attachment #626294 -
Flags: review?(bjacob) → review+
Assignee | ||
Comment 3•12 years ago
|
||
JS::NumberValue is overloaded for various integer types. For the ones that fit in a JS int, it just uses an int value; for uint32_t it has to decide whether to do an int value or a double value. I'm not sure how using a template instead of just function overloads would help here... And in particular, the desired behavior for passing in a uint32_t and an int32_t is different.
Assignee | ||
Comment 4•12 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/a4240610972e
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla15
Comment 5•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/a4240610972e
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•