| 192 | } |
| 193 | |
| 194 | GJS_JSAPI_RETURN_CONVENTION |
| 195 | static 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 | |
| 214 | GJS_JSAPI_RETURN_CONVENTION |
| 215 | static bool gjs_register_interface_impl(JSContext* cx, const char* name, |
no test coverage detected