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

Function fxGetIterator

xs/sources/xsGenerator.c:304–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302}
303
304txBoolean fxGetIterator(txMachine* the, txSlot* iterable, txSlot* iterator, txSlot* next, txBoolean optional)
305{
306 mxPushSlot(iterable);
307 mxDub();
308 mxGetID(mxID(_Symbol_iterator));
309 if (optional && (mxIsUndefined(the->stack) || mxIsNull(the->stack))) {
310 mxPop();
311 mxPop();
312 return 0;
313 }
314 mxCall();
315 mxRunCount(0);
316 if (!mxIsReference(the->stack))
317 mxTypeError("iterator: not an object");
318 if (next) {
319 mxDub();
320 mxGetID(mxID(_next));
321 mxPullSlot(next);
322 }
323 mxPullSlot(iterator);
324 return 1;
325}
326
327txBoolean fxGetIteratorFlattenable(txMachine* the, txSlot* iterable, txSlot* iterator, txSlot* next, txBoolean optional)
328{

Callers 13

fx_MapFunction · 0.85
fx_SetFunction · 0.85
fx_WeakMapFunction · 0.85
fx_WeakSetFunction · 0.85
fxGroupByFunction · 0.85
fx_Math_sumPreciseFunction · 0.85
fxRunForAwaitOfFunction · 0.85
fxRunForOfFunction · 0.85
fx_AggregateErrorFunction · 0.85
fx_Array_fromFunction · 0.85
fx_Object_fromEntriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected