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

Function fxNewIteratorHelperInstance

xs/sources/xsGenerator.c:1139–1157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137}
1138
1139txSlot* fxNewIteratorHelperInstance(txMachine* the, txSlot* iterator, txInteger step)
1140{
1141 txSlot* instance;
1142 txSlot* property;
1143 mxPush(mxIteratorHelperPrototype);
1144 instance = fxNewIteratorInstance(the, iterator, mxID(_Iterator));
1145 property = fxLastProperty(the, instance);
1146 property->ID = gxIteratorStepIDs[step];
1147 property->value.integer = step;
1148 if (mxIsNull(iterator))
1149 property = fxNextNullProperty(the, property, XS_NO_ID, XS_INTERNAL_FLAG);
1150 else {
1151 mxPushSlot(iterator);
1152 mxGetID(mxID(_next));
1153 property = fxNextSlotProperty(the, property, the->stack, XS_NO_ID, XS_INTERNAL_FLAG);
1154 mxPop();
1155 }
1156 return instance;
1157}
1158
1159void fx_IteratorHelper_prototype_next(txMachine* the)
1160{

Callers 6

fx_Iterator_concatFunction · 0.85

Calls 4

fxNewIteratorInstanceFunction · 0.85
fxLastPropertyFunction · 0.85
fxNextNullPropertyFunction · 0.85
fxNextSlotPropertyFunction · 0.85

Tested by

no test coverage detected