Closed
Bug 631132
Opened 14 years ago
Closed 14 years ago
Expose public APIs for converting doubles to signed/unsigned int per ECMA spec
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bzbarsky, Assigned: gal)
References
Details
(Keywords: dev-doc-complete, Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Could be useful in places where we have to write bindings.
Assignee | ||
Comment 1•14 years ago
|
||
Assignee | ||
Updated•14 years ago
|
Attachment #509339 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•14 years ago
|
Attachment #509339 -
Flags: approval2.0?
Assignee | ||
Comment 2•14 years ago
|
||
NPOTB, not currently in use.
Reporter | ||
Comment 3•14 years ago
|
||
Comment on attachment 509339 [details] [diff] [review]
patch
Land it.
Attachment #509339 -
Flags: review?(bzbarsky)
Attachment #509339 -
Flags: review+
Attachment #509339 -
Flags: approval2.0?
Attachment #509339 -
Flags: approval2.0+
Comment 4•14 years ago
|
||
Comment on attachment 509339 [details] [diff] [review]
patch
Does it not seem confusing to have the old JS_ValueToInt32, which rounds to nearest and fails if the double is out of range, the newer but still ancient JS_ValueToECMA{I,Ui}nt32 pair, and now these JS_DoubleTo{I,Ui}nt32 which match ECMA-262 and do not match JS_ValueToInt32?
We could rotate names to give the old, pre-ECMA JS_ValueToInt32 a long and better name, giving the ECMA names the short and "ECMA"-free names. We could mangle the names of the JS_DoubleTo{I,Ui}nt32 APIs to contain "ECMA". But just adding more mixed naming does not seem good. Right?
/be
Comment 5•14 years ago
|
||
Hyperbole for sure, but rotating names feels somewhat like rearranging deck chairs to me. The names certainly aren't pretty, but name stability seems to trump aesthetics to me, as far as external APIs go. (Although fixing bugs/enabling better features itself trumps stability, cf. operation callback breakages and so on.) If we want to regularize names, it seems most sensible to do that as part of JSAPI2.
Comment 6•14 years ago
|
||
Agree with comment 5, which leaves adding "ECMA" to the parallel DoubleTo names. Agreed?
/be
Assignee | ||
Updated•14 years ago
|
Attachment #509339 -
Flags: approval2.0+
Comment 7•14 years ago
|
||
This is blocking some of my work. Any chance this could be landed soonish?
Assignee | ||
Comment 8•14 years ago
|
||
Whiteboard: fixed-in-tracemonkey
Reporter | ||
Comment 9•14 years ago
|
||
Comment 10•14 years ago
|
||
Pre-landing I'm willing to care about names (or not care, as my previous comment seems to say). Post-landing, whatever got landed is good enough, since naming consistency is basically impossible until JSAPI2.
Assignee | ||
Comment 11•14 years ago
|
||
Ah ****. I overlooked the post review comments. I am happy with any naming. Waldo, guide me. What should I name how? I will do a little follow-up before I merge to m-c.
Comment 12•14 years ago
|
||
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 13•14 years ago
|
||
Whoops, sorry, this wasn't merged. Reopened.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•14 years ago
|
Keywords: dev-doc-needed
Comment 14•14 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
Comment 15•14 years ago
|
||
Documented:
https://developer.mozilla.org/en/SpiderMonkey/JSAPI_Reference/JS_DoubleToInt32
Also mentioned on Firefox 5 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•