| 349 | } |
| 350 | |
| 351 | GJS_JSAPI_RETURN_CONVENTION |
| 352 | static bool load_module_elements(JSContext* cx, JS::HandleObject in_object, |
| 353 | JS::MutableHandleIdVector prop_ids, |
| 354 | GFile* file) { |
| 355 | JS::RootedObject module_obj(cx, load_module_init(cx, in_object, file)); |
| 356 | if (!module_obj) |
| 357 | return false; |
| 358 | |
| 359 | JS::Rooted<JS::IdVector> ids(cx, cx); |
| 360 | if (!JS_Enumerate(cx, module_obj, &ids)) |
| 361 | return false; |
| 362 | |
| 363 | if (!prop_ids.appendAll(ids)) { |
| 364 | JS_ReportOutOfMemory(cx); |
| 365 | return false; |
| 366 | } |
| 367 | |
| 368 | return true; |
| 369 | } |
| 370 | |
| 371 | /* If error, returns false. If not found, returns true but does not touch the |
| 372 | * value at *result. If found, returns true and sets *result = true. |
no test coverage detected