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

Function fxLoadModuleStuffFrom

xs/sources/xsModule.c:3530–3556  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3528}
3529
3530txBoolean fxLoadModuleStuffFrom(txMachine* the, txSlot* queue, txSlot* module, txBoolean now)
3531{
3532 txSlot* realm = mxModuleInstanceInternal(module)->value.module.realm;
3533 txSlot* reference = mxModuleInstanceHook(module);
3534 if (mxIsReference(reference)) {
3535 txSlot* handler = mxModuleStuffHandler(reference);
3536 txSlot* importHook = (now) ? mxModuleStuffImportNowHook(reference) : mxModuleStuffImportHook(reference);
3537 if (mxIsReference(handler) && mxIsReference(importHook)) {
3538 txSlot* transfer = mxModuleInstanceTransfers(module)->value.reference->next;
3539 while (transfer) {
3540 txSlot* from = mxTransferFrom(transfer);
3541 if (from->kind != XS_NULL_KIND) {
3542 txSlot* importModule = fxImportModuleStuff(the, realm, queue, reference, from, now);
3543 txID status = mxModuleStatus(importModule);
3544 from->value.reference = importModule->value.reference;
3545 from->kind = XS_REFERENCE_KIND;
3546 if ((status == XS_MODULE_STATUS_NEW) || (status == XS_MODULE_STATUS_LOADED)) {
3547 fxQueueModule(the, queue, importModule);
3548 }
3549 }
3550 transfer = transfer->next;
3551 }
3552 return 1;
3553 }
3554 }
3555 return 0;
3556}
3557
3558void fxLoadModuleStuffFulfilled(txMachine* the)
3559{

Callers 2

fxLoadModulesFunction · 0.85
fxRunImportNowFunction · 0.85

Calls 2

fxImportModuleStuffFunction · 0.85
fxQueueModuleFunction · 0.85

Tested by

no test coverage detected