* 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.
| 190 | * Returns: The compiled JS module object. |
| 191 | */ |
| 192 | bool 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: |
nothing calls this directly
no test coverage detected