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

Method moduleLoadHook

modules/internal/internalLoader.js:185–195  ·  view source on GitHub ↗

* Called by SpiderMonkey as part of gjs_module_load(). * * @param {string} id - the module specifier * @param {string} uri - the URI where the module is to be found * @returns {Module}

(id, uri)

Source from the content-addressed store, hash-verified

183 * @returns {Module}
184 */
185 moduleLoadHook(id, uri) {
186 const priv = new ModulePrivate(id, uri);
187
188 const text = this.loadURI(parseURI(uri));
189 const compiled = this.compileModule(priv, text);
190
191 const registry = getRegistry(this.global);
192 registry.set(id, compiled);
193
194 return compiled;
195 }
196}
197
198export const internalModuleLoader = new InternalModuleLoader(globalThis, compileInternalModule);

Callers

nothing calls this directly

Calls 3

loadURIMethod · 0.95
compileModuleMethod · 0.95
setMethod · 0.80

Tested by

no test coverage detected