* gjs_internal_set_module_private: * @module: The JS module object * @private: The JS module private object for @module * * JS function exposed as `setModulePrivate` in the internal global scope. * * Sets the private object of an internal #Module object. * * Returns: JS undefined */
| 244 | * Returns: JS undefined |
| 245 | */ |
| 246 | bool gjs_internal_set_module_private(JSContext* cx, unsigned argc, |
| 247 | JS::Value* vp) { |
| 248 | JS::CallArgs args = JS::CallArgsFromVp(argc, vp); |
| 249 | JS::RootedObject module(cx), private_obj(cx); |
| 250 | if (!gjs_parse_call_args(cx, "setModulePrivate", args, "oo", "module", |
| 251 | &module, "private", &private_obj)) |
| 252 | return handle_wrong_args(cx); |
| 253 | |
| 254 | JS::SetModulePrivate(module, JS::ObjectValue(*private_obj)); |
| 255 | return true; |
| 256 | } |
| 257 | |
| 258 | /** |
| 259 | * gjs_internal_get_registry: |
nothing calls this directly
no test coverage detected