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

Method init_gobject

gi/object.cpp:3379–3389  ·  view source on GitHub ↗

* ObjectBase::init_gobject: * * This is named "init_gobject()" but corresponds to "_init()" in JS. The reason * for the name is that an "init()" method is used within SpiderMonkey to * indicate fallible initialization that must be done before an object can be * used, which is not the case here. */

Source from the content-addressed store, hash-verified

3377 * used, which is not the case here.
3378 */
3379bool ObjectBase::init_gobject(JSContext* cx, unsigned argc, JS::Value* vp) {
3380 GJS_CHECK_WRAPPER_PRIV(cx, argc, vp, argv, obj, ObjectBase, priv);
3381 if (!priv->check_is_instance(cx, "initialize"))
3382 return false;
3383
3384 std::string full_name{
3385 GJS_PROFILER_DYNAMIC_STRING(cx, priv->format_name() + "._init")};
3386 AutoProfilerLabel label{cx, "", full_name};
3387
3388 return priv->to_instance()->init_impl(cx, argv, obj);
3389}
3390
3391const struct JSClassOps ObjectBase::class_ops = {
3392 &ObjectBase::add_property,

Callers

nothing calls this directly

Calls 4

check_is_instanceMethod · 0.80
init_implMethod · 0.80
to_instanceMethod · 0.80
format_nameMethod · 0.45

Tested by

no test coverage detected