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

Method has_instance_impl

gi/interface.cpp:127–142  ·  view source on GitHub ↗

See InterfaceBase::has_instance().

Source from the content-addressed store, hash-verified

125
126// See InterfaceBase::has_instance().
127bool InterfacePrototype::has_instance_impl(JSContext* cx,
128 const JS::CallArgs& args) {
129 // This method is never called directly, so no need for error messages.
130 g_assert(args.length() == 1);
131
132 if (!args[0].isObject()) {
133 args.rval().setBoolean(false);
134 return true;
135 }
136
137 JS::RootedObject instance(cx, &args[0].toObject());
138 bool isinstance =
139 ObjectBase::typecheck(cx, instance, m_gtype, GjsTypecheckNoThrow{});
140 args.rval().setBoolean(isinstance);
141 return true;
142}
143
144const struct JSClassOps InterfaceBase::class_ops = {
145 nullptr, // addProperty

Callers 1

has_instanceMethod · 0.80

Calls 1

lengthMethod · 0.80

Tested by

no test coverage detected