MCPcopy
hub / github.com/webpack/webpack / runModule

Function runModule

test/test262.spectest.js:665–683  ·  view source on GitHub ↗
(context, code, identifier, testFile, moduleCache)

Source from the content-addressed store, hash-verified

663 };
664
665const runModule = async (context, code, identifier, testFile, moduleCache) => {
666 const module = new vm.SourceTextModule(code, {
667 context,
668 identifier,
669 importModuleDynamically: createImportModuleDynamically(
670 context,
671 testFile,
672 moduleCache
673 ),
674 initializeImportMeta: (meta) => {
675 meta.url = url.pathToFileURL(identifier).toString();
676 }
677 });
678
679 await module.link(async () => {});
680 await module.evaluate();
681
682 return module;
683};
684
685const runScript = async (
686 context,

Callers 1

Calls 4

linkMethod · 0.80
evaluateMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected