summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2018-03-22 13:00:33 -0400
committerRay Strode <rstrode@redhat.com>2018-03-28 16:31:15 -0400
commit23b394887d4dcbfc862e6c5537daa4e0922385f8 (patch)
tree5887df02740f0a83c6511a7001a83f878aab5b58
parent70906d7b033fb061d1ef3ac8f13925a432cac885 (diff)
downloadpolkit-23b394887d4dcbfc862e6c5537daa4e0922385f8.tar.gz
jsauthority: fix how classes are defined
mozjs no longer has public stub functions that implementers of JSClass objects are supposed to use. Instead NULL means to use the default stub implementations. Furthermore, the structure has been broken out into a JSClassOps sub structure now. This commit adapts the code to the new layout.
-rw-r--r--src/polkitbackend/polkitbackendjsauthority.cpp49
1 files changed, 31 insertions, 18 deletions
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp
index 6a0b4ab..caeb5d6 100644
--- a/src/polkitbackend/polkitbackendjsauthority.cpp
+++ b/src/polkitbackend/polkitbackendjsauthority.cpp
@@ -150,34 +150,47 @@ G_DEFINE_TYPE (PolkitBackendJsAuthority, polkit_backend_js_authority, POLKIT_BAC
/* ---------------------------------------------------------------------------------------------------- */
+static const struct JSClassOps js_global_class_ops = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
static JSClass js_global_class = {
"global",
JSCLASS_GLOBAL_FLAGS,
- JS_PropertyStub,
- JS_DeletePropertyStub,
- JS_PropertyStub,
- JS_StrictPropertyStub,
- JS_EnumerateStub,
- JS_ResolveStub,
- JS_ConvertStub,
- NULL,
- JSCLASS_NO_OPTIONAL_MEMBERS
+ &js_global_class_ops
};
/* ---------------------------------------------------------------------------------------------------- */
+static const struct JSClassOps js_polkit_class_ops = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
static JSClass js_polkit_class = {
"Polkit",
0,
- JS_PropertyStub,
- JS_DeletePropertyStub,
- JS_PropertyStub,
- JS_StrictPropertyStub,
- JS_EnumerateStub,
- JS_ResolveStub,
- JS_ConvertStub,
- NULL,
- JSCLASS_NO_OPTIONAL_MEMBERS
+ &js_polkit_class_ops
};
static JSBool js_polkit_log (JSContext *cx, unsigned argc, jsval *vp);