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

Function gjs_internal_set_global_module_loader

gjs/internal.cpp:128–141  ·  view source on GitHub ↗

* 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

Source from the content-addressed store, hash-verified

126 * Returns: JS undefined
127 */
128bool 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:

Callers

nothing calls this directly

Calls 3

gjs_parse_call_argsFunction · 0.85
handle_wrong_argsFunction · 0.85
gjs_set_global_slotFunction · 0.85

Tested by

no test coverage detected