MCPcopy Create free account
hub / github.com/GNOME/gjs / get_parent_constructor

Method get_parent_constructor

gi/object.cpp:3438–3455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3436}
3437
3438bool ObjectPrototype::get_parent_constructor(
3439 JSContext* cx, JS::MutableHandleObject constructor) const {
3440 GType parent_type = g_type_parent(gtype());
3441
3442 if (parent_type == G_TYPE_INVALID) {
3443 constructor.set(nullptr);
3444 return true;
3445 }
3446
3447 JS::RootedValue v_constructor(cx);
3448 if (!gjs_lookup_object_constructor(cx, parent_type, &v_constructor))
3449 return false;
3450
3451 g_assert(v_constructor.isObject() &&
3452 "gjs_lookup_object_constructor() should always produce an object");
3453 constructor.set(&v_constructor.toObject());
3454 return true;
3455}
3456
3457void ObjectPrototype::set_interfaces(GType* interface_gtypes,
3458 uint32_t n_interface_gtypes) {

Callers 1

define_classMethod · 0.80

Calls 2

setMethod · 0.80

Tested by

no test coverage detected