Bug 827581: Unify JS_GetStringCharsZAndLength with JS_GetStringCharsAndLength. r=wmccloskey

This commit is contained in:
Jim Blandy 2013-02-22 16:07:14 -08:00
parent d7e57a1fe3
commit 5323204d18

View File

@ -5972,13 +5972,8 @@ JS_GetStringLength(JSString *str)
JS_PUBLIC_API(const jschar *)
JS_GetStringCharsZ(JSContext *cx, JSString *str)
{
AssertHeapIsIdleOrStringIsFlat(cx, str);
CHECK_REQUEST(cx);
assertSameCompartment(cx, str);
JSFlatString *flat = str->ensureFlat(cx);
if (!flat)
return NULL;
return flat->chars();
size_t dummy;
return JS_GetStringCharsZAndLength(cx, str, &dummy);
}
JS_PUBLIC_API(const jschar *)