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

Function fxConstructArrayEntry

xs/sources/xsArray.c:475–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475void fxConstructArrayEntry(txMachine* the, txSlot* entry)
476{
477 txSlot* value = the->stack;
478 txSlot* key = the->stack + 1;
479 txSlot* instance;
480 txSlot* array;
481 txSlot* item;
482 mxPush(mxArrayPrototype);
483 instance = fxNewArrayInstance(the);
484 array = instance->next;
485 fxSetIndexSize(the, array, 2, XS_CHUNK);
486 item = array->value.array.address;
487 *((txIndex*)item) = 0;
488 item->ID = XS_NO_ID;
489 item->kind = key->kind;
490 item->value = key->value;
491 item++;
492 *((txIndex*)item) = 1;
493 item->ID = XS_NO_ID;
494 item->kind = value->kind;
495 item->value = value->value;
496 entry->kind = the->stack->kind;
497 entry->value = the->stack->value;
498 the->stack += 3;
499}
500
501txSlot* fxCreateArray(txMachine* the, txFlag flag, txIndex length)
502{

Callers 5

fx_RegExp_prototype_execFunction · 0.85
fx_Object_entriesFunction · 0.85

Calls 2

fxNewArrayInstanceFunction · 0.85
fxSetIndexSizeFunction · 0.85

Tested by

no test coverage detected