diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2017-05-01 22:44:34 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2017-07-09 11:41:33 -0700 |
commit | efb622e06784b0cab2ff693a4b02a9611001e640 (patch) | |
tree | a4fd9826593d791be357966db50b89018587fc8d /gjs/jsapi-class.h | |
parent | 84110781a8d5bac71343776a5bb645e86452c597 (diff) | |
download | gjs-efb622e06784b0cab2ff693a4b02a9611001e640.tar.gz |
js: New JSClass struct layout
Instead of the various operation hooks being members of JSClass directly,
now JSClass contains a pointer to a JSClassOps struct. The JSClassOps
instead contains the function pointers to the operation hooks.
For importer.cpp, we still use the internal js::Class instead of JSClass.
This also contains a pointer to another struct, JSObjectOps, which we still
need for our internal lazy enumerate hook.
https://bugzilla.gnome.org/show_bug.cgi?id=784196
Diffstat (limited to 'gjs/jsapi-class.h')
-rw-r--r-- | gjs/jsapi-class.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gjs/jsapi-class.h b/gjs/jsapi-class.h index 8b773ed1..29c44bee 100644 --- a/gjs/jsapi-class.h +++ b/gjs/jsapi-class.h @@ -171,9 +171,7 @@ extern JSPropertySpec gjs_##cname##_proto_props[]; \ extern JSFunctionSpec gjs_##cname##_proto_funcs[]; \ extern JSFunctionSpec gjs_##cname##_static_funcs[]; \ static void gjs_##cname##_finalize(JSFreeOp *fop, JSObject *obj); \ -static struct JSClass gjs_##cname##_class = { \ - type_name, \ - JSCLASS_HAS_PRIVATE | jsclass_flags, \ +static const struct JSClassOps gjs_##cname##_class_ops = { \ nullptr, /* addProperty */ \ nullptr, /* deleteProperty */ \ nullptr, /* getProperty */ \ @@ -183,6 +181,11 @@ static struct JSClass gjs_##cname##_class = { \ nullptr, /* mayResolve */ \ gjs_##cname##_finalize \ }; \ +static struct JSClass gjs_##cname##_class = { \ + type_name, \ + JSCLASS_HAS_PRIVATE | jsclass_flags, \ + &gjs_##cname##_class_ops \ +}; \ _GJS_DEFINE_GET_PROTO(cname) \ _GJS_DEFINE_DEFINE_PROTO(cname, parent_cname, ctor, gtype) |