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

Function fxIteratorNext

xs/sources/xsGenerator.c:257–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257txBoolean fxIteratorNext(txMachine* the, txSlot* iterator, txSlot* next, txSlot* value)
258{
259 mxPushSlot(iterator);
260 mxPushSlot(next);
261 mxCall();
262 mxRunCount(0);
263 if (!mxIsReference(the->stack))
264 mxTypeError("iterator result: not an object");
265 mxDub();
266 mxGetID(mxID(_done));
267 if (fxToBoolean(the, the->stack)) {
268 mxPop();
269 mxPop();
270 return 0;
271 }
272 mxPop();
273 mxGetID(mxID(_value));
274 mxPullSlot(value);
275 return 1;
276}
277
278void fxIteratorReturn(txMachine* the, txSlot* iterator, txBoolean abrupt)
279{

Callers 15

fx_MapFunction · 0.85
fx_SetFunction · 0.85
fx_Set_prototype_unionFunction · 0.85
fx_WeakMapFunction · 0.85
fx_WeakSetFunction · 0.85
fxGroupByFunction · 0.85
fx_Math_sumPreciseFunction · 0.85

Calls 1

fxToBooleanFunction · 0.85

Tested by

no test coverage detected