MCPcopy Index your code
hub / github.com/nodejs/node / getProxy

Function getProxy

test/parallel/test-vm-module-link.js:51–62  ·  view source on GitHub ↗
(parentName, parentModule)

Source from the content-addressed store, hash-verified

49 await foo.link(common.mustNotCall());
50
51 async function getProxy(parentName, parentModule) {
52 const mod = new SourceTextModule(`
53 import ${parentName} from '${parentName}';
54 export default ${parentName};
55 `);
56 await mod.link(common.mustCall((specifier, module) => {
57 assert.strictEqual(module, mod);
58 assert.strictEqual(specifier, parentName);
59 return parentModule;
60 }));
61 return mod;
62 }
63
64 const bar = await getProxy('foo', foo);
65 const baz = await getProxy('bar', bar);

Callers 1

depthFunction · 0.70

Calls 1

linkMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…