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

Function create_wrapper_array

gi/private.cpp:194–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194GJS_JSAPI_RETURN_CONVENTION
195static bool create_wrapper_array(JSContext* cx, JS::HandleObject prototype,
196 GType type, JS::MutableHandleValue rval) {
197 JS::RootedObject gtype_wrapper(cx,
198 gjs_gtype_create_gtype_wrapper(cx, type));
199 if (!gtype_wrapper)
200 return false;
201
202 JS::RootedValueArray<2> tuple(cx);
203 tuple[0].setObject(*prototype);
204 tuple[1].setObject(*gtype_wrapper);
205
206 JS::RootedObject array(cx, JS::NewArrayObject(cx, tuple));
207 if (!array)
208 return false;
209
210 rval.setObject(*array);
211 return true;
212}
213
214GJS_JSAPI_RETURN_CONVENTION
215static bool gjs_register_interface_impl(JSContext* cx, const char* name,

Callers 2

Calls 1

Tested by

no test coverage detected