| 537 | } |
| 538 | |
| 539 | GJS_JSAPI_RETURN_CONVENTION |
| 540 | static bool gjs_lookup_constructor(JSContext* cx, unsigned argc, |
| 541 | JS::Value* vp) { |
| 542 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); |
| 543 | |
| 544 | JS::RootedObject gtype_obj(cx); |
| 545 | if (!gjs_parse_call_args(cx, "lookupConstructor", args, "o", "gtype", |
| 546 | >ype_obj)) |
| 547 | return false; |
| 548 | |
| 549 | GType gtype; |
| 550 | if (!gjs_gtype_get_actual_gtype(cx, gtype_obj, >ype)) |
| 551 | return false; |
| 552 | |
| 553 | if (gtype == G_TYPE_NONE) { |
| 554 | gjs_throw(cx, "Invalid GType for constructor lookup"); |
| 555 | return false; |
| 556 | } |
| 557 | |
| 558 | return gjs_lookup_object_constructor(cx, gtype, args.rval()); |
| 559 | } |
| 560 | |
| 561 | template <GjsAtom GjsAtoms::* member> |
| 562 | GJS_JSAPI_RETURN_CONVENTION |
nothing calls this directly
no test coverage detected