MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxResolveModule

Function fxResolveModule

xs/sources/xsModule.c:2116–2142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2114}
2115
2116void fxResolveModule(txMachine* the, txSlot* module, txID moduleID, txScript* script, void* data, txDestructor destructor)
2117{
2118 if (script->codeBuffer) {
2119 if (moduleID != XS_NO_ID) {
2120 txSlot* key = fxGetKey(the, moduleID);
2121 txSlot* meta = mxModuleMeta(module);
2122 txSlot* slot;
2123 if (mxIsNull(meta)) {
2124 txSlot* instance = fxNewInstance(the);
2125 meta->value.reference = instance;
2126 meta->kind = XS_REFERENCE_KIND;
2127 }
2128 slot = fxLastProperty(the, meta->value.reference);
2129 slot = slot->next = fxNewSlot(the);
2130 slot->value.string = key->value.key.string;
2131 if (key->kind == XS_KEY_KIND)
2132 slot->kind = XS_STRING_KIND;
2133 else
2134 slot->kind = XS_STRING_X_KIND;
2135 slot->ID = mxID(_uri);
2136 slot->flag |= XS_DONT_DELETE_FLAG | XS_DONT_SET_FLAG;
2137 }
2138// mxPushClosure(module);
2139 fxRunScript(the, script, module, C_NULL, C_NULL, C_NULL, module->value.reference);
2140 mxPop();
2141 }
2142}
2143
2144txID fxResolveSpecifier(txMachine* the, txSlot* realm, txID moduleID, txSlot* name)
2145{

Callers 8

_xsbug_module_Function · 0.85
fxLoadModuleFunction · 0.85
fxLoadModuleFunction · 0.85
fxBundleLoadFunction · 0.85
fxLoadModuleFunction · 0.85
fxLoadModuleFunction · 0.85
fxLoadModuleFunction · 0.85
fxLoadModuleFunction · 0.85

Calls 5

fxGetKeyFunction · 0.85
fxNewInstanceFunction · 0.85
fxLastPropertyFunction · 0.85
fxNewSlotFunction · 0.85
fxRunScriptFunction · 0.85

Tested by

no test coverage detected