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

Function fx_Array_fromAsync_aux

xs/sources/xsArray.c:1364–1387  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1362}
1363
1364void fx_Array_fromAsync_aux(txMachine* the, txSlot* closure)
1365{
1366 txSlot* resolveFunction = closure->next;
1367 txSlot* rejectFunction = resolveFunction->next;
1368 txSlot* onIteratedFunction = rejectFunction->next;
1369 txSlot* onRejectedFunction = onIteratedFunction->next;
1370 txSlot* result = onRejectedFunction->next;
1371 txSlot* index = result->next;
1372 txSlot* iterator = index->next;
1373
1374 mxPushUndefined();
1375 mxPush(mxPromiseConstructor);
1376
1377 mxPushSlot(iterator);
1378 mxDub();
1379 mxGetID(mxID(_next));
1380 mxCall();
1381 mxRunCount(0);
1382
1383 fx_Promise_resolveAux(the);
1384 mxPop();
1385 mxPop();
1386 fxPromiseThen(the, the->stack->value.reference, onIteratedFunction, onRejectedFunction, C_NULL, rejectFunction);
1387}
1388
1389void fx_Array_fromAsync_items_next(txMachine* the)
1390{

Callers 3

fx_Array_fromAsyncFunction · 0.85

Calls 2

fx_Promise_resolveAuxFunction · 0.85
fxPromiseThenFunction · 0.85

Tested by

no test coverage detected