[gjs/wip/ptomato/mozjs52: 30/40] js: Add JSCLASS_FOREGROUND_FINALIZE flag



commit b14f147e9dce4aad0c3573eff60e9daee3e3c147
Author: Philip Chimento <philip chimento gmail com>
Date:   Mon May 1 22:49:24 2017 -0700

    js: Add JSCLASS_FOREGROUND_FINALIZE flag
    
    For all classes with a finalize hook, SpiderMonkey 52 requires that they
    either have JSCLASS_FOREGROUND_FINALIZE or JSCLASS_BACKGROUND_FINALIZE set.
    Previously, only the BACKGROUND flag existed and FOREGROUND was implicit.

 gi/boxed.cpp              |    3 ++-
 gi/fundamental.cpp        |    2 +-
 gi/gtype.cpp              |    3 ++-
 gi/ns.cpp                 |    2 +-
 gi/object.cpp             |    2 +-
 gi/repo.cpp               |    2 +-
 gi/union.cpp              |    2 +-
 gjs/importer.cpp          |    2 +-
 test/gjs-test-rooting.cpp |    2 +-
 9 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index b1eb969..ca2b596 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -947,7 +947,8 @@ static const struct JSClassOps gjs_boxed_class_ops = {
  */
 struct JSClass gjs_boxed_class = {
     "GObject_Boxed",
-    JSCLASS_HAS_PRIVATE | JSCLASS_HAS_RESERVED_SLOTS(1),
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE |
+        JSCLASS_HAS_RESERVED_SLOTS(1),
     &gjs_boxed_class_ops
 };
 
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index ae8e3f8..ad808fc 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -567,7 +567,7 @@ static const struct JSClassOps gjs_fundamental_class_ops = {
 
 struct JSClass gjs_fundamental_instance_class = {
     "GFundamental_Object",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_fundamental_class_ops
 };
 
diff --git a/gi/gtype.cpp b/gi/gtype.cpp
index 3b832da..fe365fe 100644
--- a/gi/gtype.cpp
+++ b/gi/gtype.cpp
@@ -39,7 +39,8 @@ static JSObject *gjs_gtype_get_proto(JSContext *) G_GNUC_UNUSED;
 static bool gjs_gtype_define_proto(JSContext *, JS::HandleObject,
                                    JS::MutableHandleObject);
 
-GJS_DEFINE_PROTO_ABSTRACT("GIRepositoryGType", gtype, 0);
+GJS_DEFINE_PROTO_ABSTRACT("GIRepositoryGType", gtype,
+                          JSCLASS_FOREGROUND_FINALIZE);
 
 /* priv_from_js adds a "*", so this returns "void *" */
 GJS_DEFINE_PRIV_FROM_JS(void, gjs_gtype_class);
diff --git a/gi/ns.cpp b/gi/ns.cpp
index f16ab24..6a71de9 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -169,7 +169,7 @@ static const struct JSClassOps gjs_ns_class_ops = {
 
 struct JSClass gjs_ns_class = {
     "GIRepositoryNamespace",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_ns_class_ops
 };
 
diff --git a/gi/object.cpp b/gi/object.cpp
index aa43a1c..0f27ad9 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1823,7 +1823,7 @@ static const struct JSClassOps gjs_object_class_ops = {
 
 struct JSClass gjs_object_instance_class = {
     "GObject_Object",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_object_class_ops
 };
 
diff --git a/gi/repo.cpp b/gi/repo.cpp
index b30f90a..d8fad7b 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -238,7 +238,7 @@ static const struct JSClassOps gjs_repo_class_ops = {
 
 struct JSClass gjs_repo_class = {
     "GIRepository", /* means "new GIRepository()" works */
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_repo_class_ops,
 };
 
diff --git a/gi/union.cpp b/gi/union.cpp
index 02c759d..1105593 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -305,7 +305,7 @@ static const struct JSClassOps gjs_union_class_ops = {
 
 struct JSClass gjs_union_class = {
     "GObject_Union",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_union_class_ops
 };
 
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index 5eb4bcf..65a258d 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -887,7 +887,7 @@ static const js::ObjectOps gjs_importer_object_ops = {
 
 const js::Class gjs_importer_real_class = {
     "GjsFileImporter",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &gjs_importer_class_ops,
     nullptr,
     nullptr,
diff --git a/test/gjs-test-rooting.cpp b/test/gjs-test-rooting.cpp
index 3b90b52..1f3b5dc 100644
--- a/test/gjs-test-rooting.cpp
+++ b/test/gjs-test-rooting.cpp
@@ -37,7 +37,7 @@ static const JSClassOps test_obj_class_ops = {
 
 static JSClass test_obj_class = {
     "TestObj",
-    JSCLASS_HAS_PRIVATE,
+    JSCLASS_HAS_PRIVATE | JSCLASS_FOREGROUND_FINALIZE,
     &test_obj_class_ops
 };
 


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