[gjs] Conditionally check for JS_FreezeObject
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] Conditionally check for JS_FreezeObject
- Date: Wed, 20 Oct 2010 17:20:57 +0000 (UTC)
commit 1fb9cd1058002b0555048ab8b3e401c8e011e573
Author: Colin Walters <walters verbum org>
Date: Wed Oct 20 12:33:32 2010 -0400
Conditionally check for JS_FreezeObject
This ensures we work with a pre-2.0 snapshot.
configure.ac | 3 +++
modules/lang.c | 2 +-
2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5bc7286..35c64c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -149,6 +149,9 @@ AC_MSG_CHECKING([for mozilla-js >= 2 ])
if `$PKG_CONFIG --exists $JS_PACKAGE '>=' 2`; then
AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_MOZJS_2, [1], [Define if mozilla-js is at least 2])
+ AC_CHECK_LIB([mozjs], [JS_FreezeObject], AC_DEFINE([HAVE_JS_FREEZEOBJECT], [1], [Define if we have JS_FreezeObject]),
+ , [$JS_LIBS])
+
else
AC_MSG_RESULT([no])
fi
diff --git a/modules/lang.c b/modules/lang.c
index c87d7a1..76b3e67 100644
--- a/modules/lang.c
+++ b/modules/lang.c
@@ -39,7 +39,7 @@ gjs_lang_seal(JSContext *cx, JSObject *obj, uintN argc,
return JS_FALSE;
if (!target)
return JS_TRUE;
-#ifdef HAVE_MOZJS_2
+#ifdef HAVE_JS_FREEZEOBJECT
if (deep && (!JS_DeepFreezeObject(cx, target)) )
return JS_FALSE;
if (!deep && (!JS_FreezeObject(cx, target)) )
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]