Closed Bug 674775 Opened 10 years ago Closed 10 years ago

Implement js::IndexToString(cx, uint32_t)

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla8

People

(Reporter: Waldo, Assigned: Waldo)

References

(Blocks 1 open bug)

Details

(Whiteboard: [inbound])

Attachments

(1 file, 1 obsolete file)

Attached patch Patch (obsolete) — Splinter Review
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)
Attached patch h8 hgSplinter Review
Attachment #548976 - Attachment is obsolete: true
Attachment #548976 - Flags: review?(luke)
Attachment #548980 - Flags: review?(luke)
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
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.