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

Function setStepDone

xs/platforms/mc/xsHosts.c:583–604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581#endif
582
583static void setStepDone(txMachine *the)
584{
585 gSetupPending -= 1;
586 if (gSetupPending)
587 return;
588
589 xsBeginHost(the);
590#if MODDEF_MAIN_ASYNC
591 xsVars(2);
592 xsResult = xsImport(((txPreparation *)xsPreparationAndCreation(NULL))->main);
593 xsVar(0) = xsNewHostFunction(setStepDoneFulfilled, 1);
594 xsVar(1) = xsNewHostFunction(setStepDoneRejected, 1);
595 xsCall2(xsResult, xsID("then"), xsVar(0), xsVar(1));
596#else
597 xsVars(1);
598 xsVar(0) = xsImportNow(((txPreparation *)xsPreparationAndCreation(NULL))->main);
599 xsVar(0) = xsGet(xsVar(0), xsID("default"));
600 if (xsTest(xsVar(0)) && xsIsInstanceOf(xsVar(0), xsFunctionPrototype))
601 xsCallFunction0(xsVar(0), xsGlobal);
602#endif
603 xsEndHost(the);
604}
605
606void modRunMachineSetup(txMachine *the)
607{

Callers 1

modRunMachineSetupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected