* 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. */
| 3377 | * used, which is not the case here. |
| 3378 | */ |
| 3379 | bool 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 | |
| 3391 | const struct JSClassOps ObjectBase::class_ops = { |
| 3392 | &ObjectBase::add_property, |
nothing calls this directly
no test coverage detected