[gjs] xul nightly: Conditionally adapt to JS_ClearNewbornRoots removal



commit eb490308e3301b3ccd4e1b3baa16d52d8ea1fa35
Author: Marc-Antoine Perennou <Marc-Antoine Perennou com>
Date:   Tue Jun 7 15:08:38 2011 +0200

    xul nightly: Conditionally adapt to JS_ClearNewbornRoots removal
    
    In https://hg.mozilla.org/mozilla-central/rev/3783e5f4a417 upstream
    removed JS_ClearNewbornRoots(); don't try to use it if it's not
    available.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652041
    
    Signed-off-by: Marc-Antoine Perennou <Marc-Antoine Perennou com>

 configure.ac           |    1 +
 gjs/jsapi-util-array.c |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 1dbbeb8..7a26e80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -156,6 +156,7 @@ AC_CHECK_FUNC([JS_IsScriptFrame], AC_DEFINE([HAVE_JS_ISSCRIPTFRAME], [1], [Defin
 AC_CHECK_FUNC([JS_EndPC], AC_DEFINE([HAVE_JS_ENDPC], [1], [Define if we have JS_EndPC]),)
 AC_CHECK_FUNC([JS_NewCompartmentAndGlobalObject], AC_DEFINE([HAVE_JS_NEWCOMPARTMENTANDGLOBALOBJECT], [1], [Define if we have JS_NewCompartmentAndGlobalObject]),)
 AC_CHECK_FUNC([JS_SetScriptStackQuota], AC_DEFINE([HAVE_JS_SETSCRIPTSTACKQUOTA], [1], [Define if we have JS_SetScriptStackQuota]),)
+AC_CHECK_FUNC([JS_ClearNewbornRoots], AC_DEFINE([HAVE_JS_CLEARNEWBORNROOTS], [1], [Define if we have JS_ClearNewbornRoots]),)
 CFLAGS=$saved_CFLAGS
 LIBS=$saved_LIBS
 
diff --git a/gjs/jsapi-util-array.c b/gjs/jsapi-util-array.c
index dbbd96e..bcccf13 100644
--- a/gjs/jsapi-util-array.c
+++ b/gjs/jsapi-util-array.c
@@ -311,7 +311,9 @@ gjstest_test_func_gjs_jsapi_util_array(void)
         gjs_rooted_array_append(context, array, value);
     }
 
+#ifdef HAVE_JS_CLEARNEWBORNROOTS
     JS_ClearNewbornRoots(context);
+#endif
     JS_GC(context);
 
     for (i = 0; i < N_ELEMS; i++) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]