| 3436 | } |
| 3437 | |
| 3438 | bool 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 | |
| 3457 | void ObjectPrototype::set_interfaces(GType* interface_gtypes, |
| 3458 | uint32_t n_interface_gtypes) { |
no test coverage detected