GNOME Bugzilla – Bug 638731
Adapt to JS_GetStringChars removal in xulrunner 2
Last modified: 2011-01-05 23:33:48 UTC
Created attachment 177558 [details] [review] Patch to fix GJS with configure.ac check Another removal in the xulrunner 2 JSAPI. JS_GetStringChars was considered as fallible. http://hg.mozilla.org/mozilla-central/rev/cc6d97b432cc#l39.102
Review of attachment 177558 [details] [review]: ::: configure.ac @@ +152,1 @@ I'd prefer to flip around the check; look for JS_GetStringCharsAndLength.
Created attachment 177623 [details] [review] Patch to fix GJS with configure.ac other check
Review of attachment 177623 [details] [review]: ::: gjs/byteArray.c @@ +680,3 @@ +#ifdef HAVE_JS_GETSTRINGCHARSANDLENGTH + u16_chars = JS_GetStringCharsAndLength(context, JSVAL_TO_STRING(argv[0]), &u16_len); Note that the point of the Mozilla change was that JS_GetStringCharsAndLength became a *failable* API. So we need to do: if (u16_chars == NULL) return JS_FALSE; ::: gjs/jsapi-util-string.c @@ +52,3 @@ +#ifdef HAVE_JS_GETSTRINGCHARSANDLENGTH + s = JS_GetStringCharsAndLength(context, JSVAL_TO_STRING(string_val), &s_length); Ditto here.
Created attachment 177624 [details] [review] Patch to fix GJS with configure.ac other check It should be safe now, and I added some code to cleanly fail.