| 265 | } |
| 266 | |
| 267 | static void gjs_object_custom_init(GTypeInstance* instance, |
| 268 | void* g_class [[maybe_unused]]) { |
| 269 | JSContext* cx = current_js_context(); |
| 270 | GjsContextPrivate* gjs = GjsContextPrivate::from_cx(cx); |
| 271 | |
| 272 | if (gjs->object_init_list().empty()) |
| 273 | return; |
| 274 | |
| 275 | JS::RootedObject object(cx, gjs->object_init_list().back()); |
| 276 | auto* priv_base = ObjectBase::for_js_nocheck(object); |
| 277 | g_assert(priv_base); // Should have been set in init_impl() |
| 278 | ObjectInstance* priv = priv_base->to_instance(); |
| 279 | |
| 280 | if (priv_base->gtype() != G_TYPE_FROM_INSTANCE(instance)) { |
| 281 | // This is not the most derived instance_init function, do nothing. |
| 282 | return; |
| 283 | } |
| 284 | |
| 285 | gjs->object_init_list().popBack(); |
| 286 | |
| 287 | if (!priv->init_custom_class_from_gobject(cx, object, G_OBJECT(instance))) |
| 288 | gjs_log_exception_uncaught(cx); |
| 289 | } |
| 290 | |
| 291 | static void gjs_interface_init(void* g_iface, void*) { |
| 292 | GType gtype = G_TYPE_FROM_INTERFACE(g_iface); |
nothing calls this directly
no test coverage detected