[gjs/wip/ptomato/mozjs31prep] js: Use JSCLASS_NO_OPTIONAL_MEMBERS



commit c6e38d03105314fbe376947edbb160b9d9fbbdae
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Oct 5 22:02:27 2016 -0700

    js: Use JSCLASS_NO_OPTIONAL_MEMBERS
    
    In mozjs31, some members of JSClass really become optional. Until then,
    use this macro; it's easily deletable when we switch, clearer to read,
    and safer because if an extra value gets in the initializer it will cause
    a compile error.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=742249

 gi/boxed.cpp       |    4 +---
 gi/fundamental.cpp |    6 +-----
 gi/gerror.cpp      |    4 +---
 gi/interface.cpp   |    4 +---
 gi/param.cpp       |    4 +---
 gi/union.cpp       |    4 +---
 gjs/byteArray.cpp  |    4 +---
 gjs/coverage.cpp   |    3 +--
 gjs/jsapi-util.cpp |    3 +--
 gjs/jsapi-util.h   |    4 +---
 10 files changed, 10 insertions(+), 30 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index b769e1d..2182c9b 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -939,9 +939,7 @@ struct JSClass gjs_boxed_class = {
     (JSResolveOp) boxed_new_resolve, /* needs cast since it's the new resolve signature */
     JS_ConvertStub,
     boxed_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 JSPropertySpec gjs_boxed_proto_props[] = {
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index 430c348..b8a991c 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -557,11 +557,7 @@ struct JSClass gjs_fundamental_instance_class = {
     (JSResolveOp) fundamental_instance_new_resolve, /* needs cast since it's the new resolve signature */
     JS_ConvertStub,
     fundamental_finalize,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 static JSPropertySpec gjs_fundamental_instance_proto_props[] = {
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 5db3300..f3cb37b 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -318,9 +318,7 @@ struct JSClass gjs_error_class = {
     JS_ResolveStub,
     JS_ConvertStub,
     error_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 /* We need to shadow all fields of GError, to prevent calling the getter from GBoxed
diff --git a/gi/interface.cpp b/gi/interface.cpp
index 6b4d264..c4e730b 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -169,9 +169,7 @@ struct JSClass gjs_interface_class = {
     (JSResolveOp) interface_new_resolve,
     JS_ConvertStub,
     interface_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 JSPropertySpec gjs_interface_proto_props[] = {
diff --git a/gi/param.cpp b/gi/param.cpp
index 934387d..12d4684 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -164,9 +164,7 @@ struct JSClass gjs_param_class = {
     (JSResolveOp) param_new_resolve,
     JS_ConvertStub,
     param_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 JSPropertySpec gjs_param_proto_props[] = {
diff --git a/gi/union.cpp b/gi/union.cpp
index f74fd56..86cc755 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -323,9 +323,7 @@ struct JSClass gjs_union_class = {
     (JSResolveOp) union_new_resolve, /* needs cast since it's the new resolve signature */
     JS_ConvertStub,
     union_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 JSPropertySpec gjs_union_proto_props[] = {
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index 11e4779..643d8d2 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -65,9 +65,7 @@ struct JSClass gjs_byte_array_class = {
     JS_ResolveStub,
     JS_ConvertStub,
     byte_array_finalize,
-    NULL,
-    NULL,
-    NULL, NULL, NULL
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 bool
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index b5fbcfc..498916c 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1282,8 +1282,7 @@ static JSClass coverage_global_class = {
     "GjsCoverageGlobal", JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST),
     JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
     JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
-    NULL /* checkAccess */, NULL /* call */, NULL /* hasInstance */, NULL /* construct */, NULL,
-    { NULL }
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 static bool
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 3e7b169..440d5c4 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -48,8 +48,7 @@ static JSClass global_class = {
     "GjsGlobal", JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST),
     JS_PropertyStub, JS_DeletePropertyStub, JS_PropertyStub, JS_StrictPropertyStub,
     JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, NULL,
-    NULL /* checkAccess */, NULL /* call */, NULL /* hasInstance */, NULL /* construct */, NULL,
-    { NULL }
+    JSCLASS_NO_OPTIONAL_MEMBERS
 };
 
 /**
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 811074f..fa8fda0 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -162,9 +162,7 @@ static struct JSClass gjs_##cname##_class = { \
     (JSResolveOp) gjs_##cname##_new_resolve, \
     JS_ConvertStub, \
     gjs_##cname##_finalize, \
-    NULL, \
-    NULL, \
-    NULL, NULL, NULL \
+    JSCLASS_NO_OPTIONAL_MEMBERS \
 }; \
 JS::Value gjs_##cname##_create_proto(JSContext *context, JSObject *module, const char *proto_name, JSObject 
*parent) \
 { \


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