MCPcopy Create free account
hub / github.com/ICBNetwork/web3-Wallet / link

Function link

ses.cjs:8964–8989  ·  view source on GitHub ↗
(
  compartmentPrivateFields,
  moduleAliases,
  compartment,
  moduleSpecifier)

Source from the content-addressed store, hash-verified

8962// property descriptors for their exports, which the Compartment proxies with
8963// the actual `ModuleNamespace`.
8964const link= (
8965 compartmentPrivateFields,
8966 moduleAliases,
8967 compartment,
8968 moduleSpecifier)=>
8969 {
8970 const { name: compartmentName, moduleRecords}= weakmapGet(
8971 compartmentPrivateFields,
8972 compartment);
8973
8974
8975 const moduleRecord= mapGet(moduleRecords, moduleSpecifier);
8976 if( moduleRecord=== undefined) {
8977 throw ReferenceError(
8978 `Missing link to module ${q(moduleSpecifier)} from compartment ${q(
8979 compartmentName)
8980 }`);
8981
8982 }
8983
8984 // Mutual recursion so there's no confusion about which
8985 // compartment is in context: the module record may be in another
8986 // compartment, denoted by moduleRecord.compartment.
8987 // eslint-disable-next-line no-use-before-define
8988 return instantiate(compartmentPrivateFields, moduleAliases, moduleRecord);
8989 };$h‍_once.link(link);
8990
8991function isPrecompiled(staticModuleRecord) {
8992 return typeof staticModuleRecord.__syncModuleProgram__=== 'string';

Callers 2

instantiateFunction · 0.85
compartmentImportNowFunction · 0.85

Calls 1

instantiateFunction · 0.85

Tested by

no test coverage detected