[gjs] Replace JS_SealObject by JS_FreezeObject



commit 5e1d58d3bf5f720bbbd34d46e66c2aef6764ff7a
Author: Sardem FF7 <sardemff7 pub gmail com>
Date:   Tue Oct 19 11:07:01 2010 +0200

    Replace JS_SealObject by JS_FreezeObject
    
    https://bugzilla.gnome.org/show_bug.cgi?id=632529

 modules/lang.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/modules/lang.c b/modules/lang.c
index 481a998..c87d7a1 100644
--- a/modules/lang.c
+++ b/modules/lang.c
@@ -39,8 +39,15 @@ gjs_lang_seal(JSContext *cx, JSObject *obj, uintN argc,
         return JS_FALSE;
     if (!target)
         return JS_TRUE;
+#ifdef HAVE_MOZJS_2
+    if (deep && (!JS_DeepFreezeObject(cx, target)) )
+        return JS_FALSE;
+    if (!deep && (!JS_FreezeObject(cx, target)) )
+        return JS_FALSE;
+#else
     if (!JS_SealObject(cx, target, deep))
         return JS_FALSE;
+#endif
 
     *retval = OBJECT_TO_JSVAL(target);
     return JS_TRUE;



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