Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Allow constructing/initializing a nsDependentJSString from a JSFlatString

RESOLVED FIXED in mozilla16

Status

()

Core
DOM
--
minor
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: Waldo, Assigned: Waldo)

Tracking

unspecified
mozilla16
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

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

nsDependentJSString can be infallibly initialized from a jsid, or fallibly initialized from a JSString* or jsval.  But there's a separate kind of string, JSFlatString*, which could also be used to infallibly initialize an nsDependentJSString.  We should have a constructor and infallible init method that take such a value.  (I plan to use this in a patch for bug 758912.)
Attachment #630002 - Flags: review?(bzbarsky)

Comment 1

5 years ago
Comment on attachment 630002 [details] [diff] [review]
Patch

Is the JS_FORGET_STRING_FLATNESS ugliness really needed?  :(

r=me, I guess.
Attachment #630002 - Flags: review?(bzbarsky) → review+
Comment on attachment 630002 [details] [diff] [review]
Patch

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

::: dom/base/nsJSUtils.h
@@ +102,5 @@
>  
> +  void init(JSFlatString* fstr)
> +  {
> +      new(this) nsDependentJSString(fstr);
> +  }

Assert IsEmpty(), please

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/aeceaac9445b
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.