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

Function fxLoadModuleStuff

xs/sources/xsModule.c:3506–3528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3504}
3505
3506void fxLoadModuleStuff(txMachine* the, txSlot* queue, txSlot* module, txSlot* stuff)
3507{
3508 txSlot* instance = fxCheckModuleStuffInstance(the, stuff);
3509 txSlot* internal = mxModuleStuffInstanceModule(instance);
3510 if (mxIsReference(internal)) {
3511 txSlot* loader = mxModuleLoader(module);
3512 fxOverrideModule(the, queue, mxModuleStuffModules(loader), C_NULL, module->value.reference, internal->value.reference);
3513 loader->kind = XS_UNDEFINED_KIND;
3514 }
3515 else {
3516 txSlot* source = mxModuleStuffInstanceSource(instance);
3517 if (mxIsModuleSource(source->value.reference))
3518 fxDuplicateModuleTransfers(the, source, module);
3519 else
3520 fxLoadVirtualModuleSource(the, source, module->value.reference);
3521 internal->value.reference = module->value.reference;
3522 internal->kind = XS_REFERENCE_KIND;
3523 internal = mxModuleHook(module);
3524 internal->value.reference = instance;
3525 internal->kind = XS_REFERENCE_KIND;
3526 mxModuleStatus(module) = XS_MODULE_STATUS_LOADED;
3527 }
3528}
3529
3530txBoolean fxLoadModuleStuffFrom(txMachine* the, txSlot* queue, txSlot* module, txBoolean now)
3531{

Callers 2

fxImportModuleStuffFunction · 0.85

Calls 4

fxOverrideModuleFunction · 0.85

Tested by

no test coverage detected