Closed Bug 645121 Opened 9 years ago Closed 9 years ago

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

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set

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+
http://hg.mozilla.org/tracemonkey/rev/9c065e8e72f6
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.
http://hg.mozilla.org/mozilla-central/rev/9c065e8e72f6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.