Shanmugham Sundaram wrote:
Till FF 32, we did not have issue in compiling the following function
const jschar* GetStringCharsZ(JSContext *cx, JSString *str) const throw()
{
if( !cx || !str)
{
return NULL;
}
return JS_GetStringCharsZ(cx, str);
}
It's no longer safe to refer to the contents of a JSString (except in
the rare case when it's an external string, in which case the rules for
whatever sort of external string it is apply). Instead you will need to
make a copy. If you want a temporary XPCOM string then use an
nsAutoJSString, if you have an existing XPCOM string then use
AssignJSString, or if you have a character buffer then use
JS_EncodeStringToBuffer, JS_DeflateStringToUTF8Buffer or JS_CopyStringChars.
--
Warning: May contain traces of nuts.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform