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

Function gjs_internal_compile_internal_module

gjs/internal.cpp:192–205  ·  view source on GitHub ↗

* gjs_internal_compile_internal_module: * @uri: The URI of the module (JS string) * @source: The source text of the module (JS string) * * JS function exposed as `compileInternalModule` in the internal global scope. * * Compiles a module source text within the internal global's realm. * * NOTE: Modules compiled with this function can only be executed * within the internal global's realm.

Source from the content-addressed store, hash-verified

190 * Returns: The compiled JS module object.
191 */
192bool gjs_internal_compile_internal_module(JSContext* cx, unsigned argc,
193 JS::Value* vp) {
194 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
195
196 Gjs::AutoInternalRealm ar{cx};
197
198 JS::UniqueChars uri;
199 JS::RootedString source(cx);
200 if (!gjs_parse_call_args(cx, "compileInternalModule", args, "sS", "uri",
201 &uri, "source", &source))
202 return handle_wrong_args(cx);
203
204 return compile_module(cx, uri, source, args.rval());
205}
206
207/**
208 * gjs_internal_compile_module:

Callers

nothing calls this directly

Calls 3

gjs_parse_call_argsFunction · 0.85
handle_wrong_argsFunction · 0.85
compile_moduleFunction · 0.85

Tested by

no test coverage detected