* gjs_internal_set_global_module_loader: * @global: the JS global object * @loader: the JS module loader object to store in @global * * JS function exposed as `setGlobalModuleLoader` in the internal global scope. * * Sets the MODULE_LOADER slot of @global. @loader should be an instance of * ModuleLoader or InternalModuleLoader. Its `moduleResolveHook` and * `moduleLoadHook` properties will
| 126 | * Returns: JS undefined |
| 127 | */ |
| 128 | bool gjs_internal_set_global_module_loader(JSContext* cx, unsigned argc, |
| 129 | JS::Value* vp) { |
| 130 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); |
| 131 | JS::RootedObject global(cx), loader(cx); |
| 132 | if (!gjs_parse_call_args(cx, "setGlobalModuleLoader", args, "oo", "global", |
| 133 | &global, "loader", &loader)) |
| 134 | return handle_wrong_args(cx); |
| 135 | |
| 136 | gjs_set_global_slot(global, GjsGlobalSlot::MODULE_LOADER, |
| 137 | JS::ObjectValue(*loader)); |
| 138 | |
| 139 | args.rval().setUndefined(); |
| 140 | return true; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * compile_module: |
nothing calls this directly
no test coverage detected