GNOME Bugzilla – Bug 642186
xulrunner API: strict mode support changed some callbacks
Last modified: 2011-02-16 16:41:14 UTC
They are implementing the strict mode support, which needs some strict mode aware callbacks. One is the property set one, which is used in GJS. Mozilla Mercurial changeset: http://hg.mozilla.org/mozilla-central/rev/4b56bfdf61a7
Working on it, still the conditionnal check to do and some warning to shut up and it's ok
Created attachment 180733 [details] [review] Conditionally adapt to new strict setters This patch allows all gjs tests to pass with xulrunner from hg
Created attachment 180913 [details] [review] Conditionally adapt to new strict setters Simplify patch
Created attachment 180922 [details] [review] Just an example to avoid the warning Btw, I didn't find the commit which involved that, but I think it's linked : JSLocaleCallbacks now needs a JSErrorCallback Here is a dummy patch just to show the structure of it, no implementation
Created attachment 180928 [details] [review] Silent a warning Ok, actually this fifth element has been there for some time now, the warning was not cuased by this missing, but because of an argument of gjs_locale_to_unicode being a char instead of a const char
Here is the commit (dunno how to dynamically check for this one, though) http://hg.mozilla.org/mozilla-central/rev/f971ad6ed5a5
(In reply to comment #6) > Here is the commit (dunno how to dynamically check for this one, though) > http://hg.mozilla.org/mozilla-central/rev/f971ad6ed5a5 You can do something like: AC_MSG_CHECKING([whether JSLocaleToUnicode takes a const char*]) _SAVED_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_TRY_COMPILE([#include "jspubtd.h"], [...], [ac_cv_JSLocaleToUnicode_const_char=1 AC_MSG_RESULT([yes])], [ac_cv_JSLocaleToUnicode_const_char=0 AC_MSG_RESULT([no])]) CFLAGS="$_SAVED_CFLAGS"
Created attachment 180939 [details] [review] Silent a warning with JSLocaleToUnicode Thx, done that in a slightly different way, but with the same concept
Created attachment 180940 [details] [review] Silent a warning with JSLocaleToUnicode Copy-paste fail, sorry
Review of attachment 180913 [details] [review]: This won't actually compile on older xulrunner, will it? There's no JSStringPropertyStub there. We may have to add a wrapper in jsapi-util.h?
Review of attachment 180940 [details] [review]: "Silent" should be "Silence" in your commit message. ::: configure.ac @@ +214,3 @@ + )], + [ac_cv_JSLocaleToUnicode_const_char=yes], + [ac_cv_JSLocaleToUnicode_const_char=no]) I am confused why you're using "ac_cv_" prefix; those are supposed to be "private" to autoconf, right? Why not name the variable have_jslocale_to_unicode_const say?
(In reply to comment #10) > Review of attachment 180913 [details] [review]: > > This won't actually compile on older xulrunner, will it? There's no > JSStringPropertyStub there. We may have to add a wrapper in jsapi-util.h? It will, I think, see : diff --git a/gjs/compat.h b/gjs/compat.h index d418a22..09c2b98 100644 --- a/gjs/compat.h +++ b/gjs/compat.h @@ -135,6 +135,10 @@ gjs_##name##_constructor(JSContext *context, \ #endif +#ifndef HAVE_JS_STRICTPROPERTYSTUB +#define JS_StrictPropertyStub JS_PropertyStub +#endif + G_END_DECLS
Created attachment 181020 [details] [review] Silence a warning with JSLocaleToUnicode Renamed (didn't know how to name it so just took the name from the comment above)
(In reply to comment #12) > +#ifndef HAVE_JS_STRICTPROPERTYSTUB > +#define JS_StrictPropertyStub JS_PropertyStub > +#endif > + > G_END_DECLS Ah, I missed that. Yes, I can confirm we still compile on xulrunner 1.9.2 from Fedora 14.
Pushed both patches, thank you!