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

Function fxNewAsyncFromSyncIteratorInstance

xs/sources/xsGenerator.c:2038–2072  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2036}
2037
2038txSlot* fxNewAsyncFromSyncIteratorInstance(txMachine* the)
2039{
2040 txSlot* iterator = the->stack;
2041 txSlot* instance;
2042 txSlot* slot;
2043 txSlot* function;
2044 txSlot* home;
2045 mxPush(mxAsyncFromSyncIteratorPrototype);
2046 instance = fxNewObjectInstance(the);
2047 slot = fxLastProperty(the, instance);
2048
2049 slot = fxNextSlotProperty(the, slot, iterator, mxID(_iterator), XS_INTERNAL_FLAG);
2050
2051 mxPushSlot(iterator);
2052 mxGetID(mxID(_next));
2053 slot = fxNextSlotProperty(the, slot, the->stack, XS_NO_ID, XS_INTERNAL_FLAG);
2054 mxPop();
2055
2056 function = fxNewHostFunction(the, fxAsyncFromSyncIteratorDone, 1, XS_NO_ID, mxAsyncFromSyncIteratorDoneProfileID);
2057 home = mxFunctionInstanceHome(function);
2058 home->value.home.object = instance;
2059 slot = fxNextSlotProperty(the, slot, the->stack, XS_NO_ID, XS_INTERNAL_FLAG);
2060 mxPop();
2061
2062 slot = fxNextBooleanProperty(the, slot, 0, XS_NO_ID, XS_INTERNAL_FLAG);
2063
2064 function = fxNewHostFunction(the, fxAsyncFromSyncIteratorFailed, 1, XS_NO_ID, mxAsyncFromSyncIteratorDoneProfileID);
2065 home = mxFunctionInstanceHome(function);
2066 home->value.home.object = instance;
2067 slot = fxNextSlotProperty(the, slot, the->stack, XS_NO_ID, XS_INTERNAL_FLAG);
2068 mxPop();
2069
2070 mxPullSlot(iterator);
2071 return instance;
2072}
2073
2074void fx_AsyncFromSyncIterator_prototype_aux(txMachine* the, txFlag status, txSlot* iterator, txBoolean* flag)
2075{

Callers 2

fxRunForAwaitOfFunction · 0.85
fx_Array_fromAsyncFunction · 0.85

Calls 5

fxNewObjectInstanceFunction · 0.85
fxLastPropertyFunction · 0.85
fxNextSlotPropertyFunction · 0.85
fxNewHostFunctionFunction · 0.85
fxNextBooleanPropertyFunction · 0.85

Tested by

no test coverage detected