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

Function fxIteratorReturn

xs/sources/xsGenerator.c:278–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278void fxIteratorReturn(txMachine* the, txSlot* iterator, txBoolean abrupt)
279{
280 if (abrupt)
281 mxPush(mxException);
282 mxTry(the) {
283 mxPushSlot(iterator);
284 mxDub();
285 mxGetID(mxID(_return));
286 if (mxIsUndefined(the->stack) || mxIsNull(the->stack))
287 mxPop();
288 else {
289 mxCall();
290 mxRunCount(0);
291 if (!mxIsReference(the->stack))
292 mxTypeError("iterator result: not an object");
293 }
294 mxPop();
295 }
296 mxCatch(the) {
297 if (!abrupt)
298 fxJump(the);
299 }
300 if (abrupt)
301 mxPull(mxException);
302}
303
304txBoolean fxGetIterator(txMachine* the, txSlot* iterable, txSlot* iterator, txSlot* next, txBoolean optional)
305{

Callers 15

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

Calls 1

fxJumpFunction · 0.85

Tested by

no test coverage detected