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

Method typecheck_impl

gi/wrapperutils.h:1244–1253  ·  view source on GitHub ↗

* GIWrapperInstance::typecheck_impl: * * See GIWrapperBase::typecheck(). Checks that the instance's wrapped * pointer is of the correct GType or GI info. Does not throw a JS * exception. * * It's possible to override typecheck_impl() if you need an extra step in * the check. */

Source from the content-addressed store, hash-verified

1242 * the check.
1243 */
1244 [[nodiscard]]
1245 bool typecheck_impl(const GI::BaseInfo& expected_info) const {
1246 if constexpr (Prototype::may_not_have_info) {
1247 if (Base::info())
1248 return Base::info().ref() == expected_info;
1249 } else {
1250 return Base::info() == expected_info;
1251 }
1252 return true;
1253 }
1254 [[nodiscard]]
1255 bool typecheck_impl(GType expected_gtype) const {
1256 g_assert(expected_gtype != G_TYPE_NONE &&

Callers 1

typecheckMethod · 0.45

Calls 2

infoFunction · 0.85
refMethod · 0.45

Tested by

no test coverage detected