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

Function fx_Iterator_concat

xs/sources/xsGenerator.c:421–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void fx_Iterator_concat(txMachine* the)
422{
423 txSlot* list = fxNewInstance(the);
424 txSlot* slot = list;
425 txSlot* property;
426 txInteger c = mxArgc, i;
427 for (i = 0; i < c; i++) {
428 txSlot* item = mxArgv(i);
429 if (!mxIsReference(item))
430 mxTypeError("items[%d]: not an object", i);
431 mxPushSlot(item);
432 slot = fxNextSlotProperty(the, slot, the->stack, XS_NO_ID, XS_NO_FLAG);
433 mxGetID(mxID(_Symbol_iterator));
434 if (!fxIsCallable(the, the->stack))
435 mxTypeError("items[%d]: not iterable", i);
436 slot = fxNextSlotProperty(the, slot, the->stack, XS_NO_ID, XS_NO_FLAG);
437 mxPop();
438 }
439 mxPushNull();
440 property = fxLastProperty(the, fxNewIteratorHelperInstance(the, the->stack, mx_Iterator_concat));
441 property = fxNextReferenceProperty(the, property, list, XS_NO_ID, XS_INTERNAL_FLAG);
442 mxPullSlot(mxResult);
443 mxPop();
444 mxPop();
445}
446
447txBoolean fx_Iterator_concat_step(txMachine* the, txSlot* iterator, txSlot* next, txSlot* extra, txSlot* value, txFlag status)
448{

Callers

nothing calls this directly

Calls 6

fxNewInstanceFunction · 0.85
fxNextSlotPropertyFunction · 0.85
fxIsCallableFunction · 0.85
fxLastPropertyFunction · 0.85
fxNextReferencePropertyFunction · 0.85

Tested by

no test coverage detected