Closed Bug 645121 Opened 14 years ago Closed 14 years ago

Add StringBuffer::finishAtom to create an atom from a string buffer

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla5

People

(Reporter: Waldo, Assigned: Waldo)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

Attached patch PatchSplinter Review
If you're consing up a string which will be atomized immediately after creation, why not just create an atom from the start? The new JSON parser (bug 589664) will need this, but right now all string buffer users just want a string, so it's not used for the moment. I added a JSAPI test to exercise it in the meantime (and afterward, since it's kind of a unit-testy thing).
Attachment #521896 - Flags: review?(igor)
Attachment #521896 - Flags: review?(igor) → review+
Whiteboard: fixed-in-tracemonkey
Target Milestone: --- → mozilla2.2
FWIW, this is almost the same as TokenStream::atomize(), except it doesn't check for the empty atom.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: