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

Function gjs_lookup_constructor

gi/private.cpp:539–559  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537}
538
539GJS_JSAPI_RETURN_CONVENTION
540static 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 &gtype_obj))
547 return false;
548
549 GType gtype;
550 if (!gjs_gtype_get_actual_gtype(cx, gtype_obj, &gtype))
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
561template <GjsAtom GjsAtoms::* member>
562GJS_JSAPI_RETURN_CONVENTION

Callers

nothing calls this directly

Calls 4

gjs_parse_call_argsFunction · 0.85
gjs_throwFunction · 0.85

Tested by

no test coverage detected