The default bug view has changed. See this FAQ.

Implement js::IndexToString(cx, uint32_t)

RESOLVED FIXED in mozilla8

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

(Blocks: 1 bug)

unspecified
mozilla8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(1 attachment, 1 obsolete attachment)

Created attachment 548976 [details] [diff] [review]
Patch

Upcoming work on using separate storage for element properties (property names which are the string versions of unsigned 32-bit integers) will need to be able to get a string for a given uint32_t, at least as long as jsid can't hold a full 32-bit-integer range of values.  Implement js::IndexToString to support this, and in the absence of users exactly right now, add a JSAPI test that uses private headers to test it.
Attachment #548976 - Flags: review?(luke)
Created attachment 548980 [details] [diff] [review]
h8 hg
Attachment #548976 - Attachment is obsolete: true
Attachment #548976 - Flags: review?(luke)
Attachment #548980 - Flags: review?(luke)

Comment 2

6 years ago
Comment on attachment 548980 [details] [diff] [review]
h8 hg

Review of attachment 548980 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/vm/String-inl.h
@@ +206,5 @@
> +inline JSStaticAtom &
> +JSAtom::uintStatic(uint32 u)
> +{
> +    JS_ASSERT(hasUintStatic(u));
> +    return *reinterpret_cast<JSStaticAtom *>(const_cast<JSString::Data *>(intStaticTable[u]));

This casting shold match the casting in JSAtom::intStatic.  Personally, I find this a bit verbose and not terribly informative, but you pick.  I guess you already did :)
Attachment #548980 - Flags: review?(luke) → review+
...or even better: just make the int32 version call the uint32 version.  (With some pre-validity-checking assertions still, of course.)  :-)

Landing shortly...
http://hg.mozilla.org/integration/mozilla-inbound/rev/375dba36b860
Whiteboard: [inbound]
Target Milestone: --- → mozilla8
http://hg.mozilla.org/mozilla-central/rev/375dba36b860
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.