MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / makeModuleReceive

Function makeModuleReceive

src/parseTools.mjs:943–953  ·  view source on GitHub ↗
(localName, moduleName)

Source from the content-addressed store, hash-verified

941
942// Make code to receive a value on the incoming Module object.
943function makeModuleReceive(localName, moduleName) {
944 moduleName ||= localName;
945 checkReceiving(moduleName);
946 let ret = '';
947 if (expectToReceiveOnModule(moduleName)) {
948 // Usually the local we use is the same as the Module property name,
949 // but sometimes they must differ.
950 ret = `if (Module['${moduleName}']) ${localName} = Module['${moduleName}'];`;
951 }
952 return ret;
953}
954
955function makeModuleReceiveExpr(name, defaultValue) {
956 checkReceiving(name);

Callers 3

postlibrary.jsFile · 0.85
libfs_shared.jsFile · 0.85
libcore.jsFile · 0.85

Calls 2

checkReceivingFunction · 0.85
expectToReceiveOnModuleFunction · 0.70

Tested by

no test coverage detected