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

Function fx_Array_fromAsync_onMapped

xs/sources/xsArray.c:1481–1505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1479}
1480
1481void fx_Array_fromAsync_onMapped(txMachine* the)
1482{
1483 txSlot* slot = mxFunctionInstanceHome(mxFunction->value.reference);
1484 txSlot* closure = slot->value.home.object;
1485 txSlot* resolveFunction = closure->next;
1486 txSlot* rejectFunction = resolveFunction->next;
1487 txSlot* onIteratedFunction = rejectFunction->next;
1488 txSlot* onRejectedFunction = onIteratedFunction->next;
1489 txSlot* result = onRejectedFunction->next;
1490 txSlot* index = result->next;
1491 txSlot* iterator = index->next;
1492
1493 mxTry(the) {
1494 mxPushSlot(mxArgv(0));
1495 mxPushSlot(result);
1496 mxDefineIndex(index->value.integer, 0, XS_GET_ONLY);
1497 mxPop();
1498 index->value.integer++;
1499 fx_Array_fromAsync_aux(the, closure);
1500 }
1501 mxCatch(the) {
1502 fxIteratorReturn(the, iterator, 1);
1503 fxThrow(the, NULL, 0);
1504 }
1505}
1506
1507void fx_Array_fromAsync_onRejected(txMachine* the)
1508{

Callers

nothing calls this directly

Calls 3

fx_Array_fromAsync_auxFunction · 0.85
fxIteratorReturnFunction · 0.85
fxThrowFunction · 0.85

Tested by

no test coverage detected