[gjs/wip/ptomato/mozjs38: 6/20] js: Discontinue JSClass stubs



commit 2e218c167c54238f6edbd05e2b5b84225f60802c
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Jan 11 23:11:20 2017 -0800

    js: Discontinue JSClass stubs
    
    JSClass now simply takes NULL to indicate that an operation should
    default to a stub function.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777962

 gi/boxed.cpp              |   12 ++++++------
 gi/function.cpp           |   14 +++++++-------
 gi/fundamental.cpp        |   12 ++++++------
 gi/gerror.cpp             |   14 +++++++-------
 gi/interface.cpp          |   12 ++++++------
 gi/ns.cpp                 |   12 ++++++------
 gi/object.cpp             |    8 ++++----
 gi/param.cpp              |   12 ++++++------
 gi/repo.cpp               |   12 ++++++------
 gi/union.cpp              |   12 ++++++------
 gjs/byteArray.cpp         |   10 +++++-----
 gjs/coverage.cpp          |   14 +++++++-------
 gjs/importer.cpp          |   10 +++++-----
 gjs/jsapi-util.cpp        |   14 +++++++-------
 gjs/jsapi-util.h          |   14 +++++++-------
 test/gjs-test-rooting.cpp |   14 +++++++-------
 16 files changed, 98 insertions(+), 98 deletions(-)
---
diff --git a/gi/boxed.cpp b/gi/boxed.cpp
index 51150e1..280f396 100644
--- a/gi/boxed.cpp
+++ b/gi/boxed.cpp
@@ -919,13 +919,13 @@ struct JSClass gjs_boxed_class = {
     JSCLASS_NEW_RESOLVE |
     JSCLASS_HAS_RESERVED_SLOTS(1) |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) boxed_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     boxed_finalize,
     NULL,  /* call */
     NULL,  /* hasInstance */
diff --git a/gi/function.cpp b/gi/function.cpp
index 0cbbb3d..9b97700 100644
--- a/gi/function.cpp
+++ b/gi/function.cpp
@@ -1469,13 +1469,13 @@ struct JSClass gjs_function_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_BACKGROUND_FINALIZE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     function_finalize,
     function_call
 };
diff --git a/gi/fundamental.cpp b/gi/fundamental.cpp
index d145197..757f75d 100644
--- a/gi/fundamental.cpp
+++ b/gi/fundamental.cpp
@@ -552,13 +552,13 @@ struct JSClass gjs_fundamental_instance_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_IMPLEMENTS_BARRIERS |
     JSCLASS_NEW_RESOLVE,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) fundamental_instance_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     fundamental_finalize,
     NULL,  /* call */
     NULL,  /* hasInstance */
diff --git a/gi/gerror.cpp b/gi/gerror.cpp
index 6b19e2f..2902f0e 100644
--- a/gi/gerror.cpp
+++ b/gi/gerror.cpp
@@ -273,13 +273,13 @@ struct JSClass gjs_error_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_BACKGROUND_FINALIZE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     error_finalize
 };
 
diff --git a/gi/interface.cpp b/gi/interface.cpp
index 3206013..e72b474 100644
--- a/gi/interface.cpp
+++ b/gi/interface.cpp
@@ -161,13 +161,13 @@ struct JSClass gjs_interface_class = {
     JSCLASS_NEW_RESOLVE |
     JSCLASS_BACKGROUND_FINALIZE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) interface_new_resolve,
-    JS_ConvertStub,
+    NULL,  /* convert */
     interface_finalize
 };
 
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 6af1138..f22f631 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -160,13 +160,13 @@ struct JSClass gjs_ns_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_NEW_RESOLVE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) ns_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     ns_finalize
 };
 
diff --git a/gi/object.cpp b/gi/object.cpp
index d59ab7e..67d6f39 100644
--- a/gi/object.cpp
+++ b/gi/object.cpp
@@ -1941,13 +1941,13 @@ struct JSClass gjs_object_instance_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_NEW_RESOLVE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
     object_instance_get_prop,
     object_instance_set_prop,
-    JS_EnumerateStub,
+    NULL,  /* enumerate */
     (JSResolveOp) object_instance_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     object_instance_finalize,
     NULL,
     NULL,
diff --git a/gi/param.cpp b/gi/param.cpp
index 3e6db92..bd44b81 100644
--- a/gi/param.cpp
+++ b/gi/param.cpp
@@ -148,13 +148,13 @@ struct JSClass gjs_param_class = {
     JSCLASS_NEW_RESOLVE |
     JSCLASS_BACKGROUND_FINALIZE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) param_new_resolve,
-    JS_ConvertStub,
+    NULL,  /* convert */
     param_finalize
 };
 
diff --git a/gi/repo.cpp b/gi/repo.cpp
index 133ac07..a29265e 100644
--- a/gi/repo.cpp
+++ b/gi/repo.cpp
@@ -212,13 +212,13 @@ struct JSClass gjs_repo_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_NEW_RESOLVE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) repo_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     repo_finalize
 };
 
diff --git a/gi/union.cpp b/gi/union.cpp
index 2fc16c0..265d8c4 100644
--- a/gi/union.cpp
+++ b/gi/union.cpp
@@ -290,13 +290,13 @@ struct JSClass gjs_union_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_NEW_RESOLVE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
     (JSResolveOp) union_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     union_finalize
 };
 
diff --git a/gjs/byteArray.cpp b/gjs/byteArray.cpp
index f416ffc..2809abd 100644
--- a/gjs/byteArray.cpp
+++ b/gjs/byteArray.cpp
@@ -58,13 +58,13 @@ struct JSClass gjs_byte_array_class = {
     JSCLASS_HAS_PRIVATE |
     JSCLASS_BACKGROUND_FINALIZE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
     (JSPropertyOp)byte_array_get_prop,
     (JSStrictPropertyOp)byte_array_set_prop,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     byte_array_finalize
 };
 
diff --git a/gjs/coverage.cpp b/gjs/coverage.cpp
index cee87ba..d8a6ae7 100644
--- a/gjs/coverage.cpp
+++ b/gjs/coverage.cpp
@@ -1262,13 +1262,13 @@ static JSClass coverage_global_class = {
     "GjsCoverageGlobal",
     JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST) |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     NULL,  /* finalize */
     NULL,  /* call */
     NULL,  /* hasInstance */
diff --git a/gjs/importer.cpp b/gjs/importer.cpp
index b5ce092..d896206 100644
--- a/gjs/importer.cpp
+++ b/gjs/importer.cpp
@@ -946,13 +946,13 @@ struct JSClass gjs_importer_class = {
     JSCLASS_NEW_RESOLVE |
     JSCLASS_NEW_ENUMERATE |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
     (JSEnumerateOp) importer_new_enumerate, /* needs cast since it's the new enumerate signature */
     (JSResolveOp) importer_new_resolve, /* needs cast since it's the new resolve signature */
-    JS_ConvertStub,
+    NULL,  /* convert */
     importer_finalize
 };
 
diff --git a/gjs/jsapi-util.cpp b/gjs/jsapi-util.cpp
index 0bfc1f1..22e301c 100644
--- a/gjs/jsapi-util.cpp
+++ b/gjs/jsapi-util.cpp
@@ -48,13 +48,13 @@ static JSClass global_class = {
     "GjsGlobal",
     JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(GJS_GLOBAL_SLOT_LAST) |
     JSCLASS_IMPLEMENTS_BARRIERS,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     NULL,  /* finalize */
     NULL,  /* call */
     NULL,  /* hasInstance */
diff --git a/gjs/jsapi-util.h b/gjs/jsapi-util.h
index 3afcf02..4445521 100644
--- a/gjs/jsapi-util.h
+++ b/gjs/jsapi-util.h
@@ -178,13 +178,13 @@ static void gjs_##cname##_finalize(JSFreeOp *fop, JSObject *obj); \
 static struct JSClass gjs_##cname##_class = { \
     type_name, \
     JSCLASS_HAS_PRIVATE | jsclass_flags,                                       \
-    JS_PropertyStub, \
-    JS_DeletePropertyStub, \
-    JS_PropertyStub, \
-    JS_StrictPropertyStub, \
-    JS_EnumerateStub,\
-    JS_ResolveStub,                                                            \
-    JS_ConvertStub, \
+    NULL,  /* addProperty */                                                   \
+    NULL,  /* deleteProperty */                                                \
+    NULL,  /* getProperty */                                                   \
+    NULL,  /* setProperty */                                                   \
+    NULL,  /* enumerate */                                                     \
+    NULL,  /* resolve */                                                       \
+    NULL,  /* convert */                                                       \
     gjs_##cname##_finalize                                                     \
 }; \
 JS::Value                                                                      \
diff --git a/test/gjs-test-rooting.cpp b/test/gjs-test-rooting.cpp
index 8d5af30..a5f009e 100644
--- a/test/gjs-test-rooting.cpp
+++ b/test/gjs-test-rooting.cpp
@@ -27,13 +27,13 @@ test_obj_finalize(JSFreeOp *fop,
 static JSClass test_obj_class = {
     "TestObj",
     JSCLASS_HAS_PRIVATE,
-    JS_PropertyStub,
-    JS_DeletePropertyStub,
-    JS_PropertyStub,
-    JS_StrictPropertyStub,
-    JS_EnumerateStub,
-    JS_ResolveStub,
-    JS_ConvertStub,
+    NULL,  /* addProperty */
+    NULL,  /* deleteProperty */
+    NULL,  /* getProperty */
+    NULL,  /* setProperty */
+    NULL,  /* enumerate */
+    NULL,  /* resolve */
+    NULL,  /* convert */
     test_obj_finalize
 };
 


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