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

Method new_enumerate_impl

gi/interface.cpp:43–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43bool InterfacePrototype::new_enumerate_impl(
44 JSContext* cx, JS::HandleObject, JS::MutableHandleIdVector properties,
45 bool only_enumerable [[maybe_unused]]) {
46 if (!info())
47 return true;
48
49 GI::InterfaceInfo::MethodsIterator methods = info()->methods();
50 int n_methods = methods.size();
51 if (!properties.reserve(properties.length() + n_methods)) {
52 JS_ReportOutOfMemory(cx);
53 return false;
54 }
55
56 for (GI::AutoFunctionInfo meth_info : methods) {
57 if (meth_info.is_method()) {
58 const char* name = meth_info.name();
59 jsid id = gjs_intern_string_to_id(cx, name);
60 if (id.isVoid())
61 return false;
62 properties.infallibleAppend(id);
63 }
64 }
65
66 return true;
67}
68
69// See GIWrapperBase::resolve().
70bool InterfacePrototype::resolve_impl(JSContext* cx, JS::HandleObject obj,

Callers

nothing calls this directly

Calls 7

infoFunction · 0.85
gjs_intern_string_to_idFunction · 0.85
lengthMethod · 0.80
methodsMethod · 0.45
sizeMethod · 0.45
is_methodMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected