diff options
author | Ray Strode <rstrode@redhat.com> | 2018-03-22 13:00:33 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2018-04-03 14:16:21 -0400 |
commit | 0b6db90e5bb35ea4c50fe6adc334fff645397f92 (patch) | |
tree | 08a61f77083e374cefbeadbb177be88325fe698b /src/polkitbackend/polkitbackendjsauthority.cpp | |
parent | 81b92d6c36a086fb370b69440b0a05dfbfa23085 (diff) | |
download | polkit-0b6db90e5bb35ea4c50fe6adc334fff645397f92.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.
Signed-off-by: Ray Strode <rstrode@redhat.com>
https://bugs.freedesktop.org/show_bug.cgi?id=105865
Diffstat (limited to 'src/polkitbackend/polkitbackendjsauthority.cpp')
-rw-r--r-- | src/polkitbackend/polkitbackendjsauthority.cpp | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp index 0f3761b..384ea79 100644 --- a/src/polkitbackend/polkitbackendjsauthority.cpp +++ b/src/polkitbackend/polkitbackendjsauthority.cpp @@ -149,34 +149,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); |