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

Function fxKeyAt

xs/sources/xsSymbol.c:473–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

471}
472
473void fxKeyAt(txMachine* the, txID id, txIndex index, txSlot* slot)
474{
475 if (id) {
476 txSlot* key = fxGetKey(the, id);
477 if (key->flag & XS_DONT_ENUM_FLAG) {
478 if (key->kind == XS_KEY_KIND) {
479 slot->kind = XS_STRING_KIND;
480 slot->value.string = key->value.key.string;
481 }
482 else{
483 slot->kind = XS_STRING_X_KIND;
484 slot->value.string = key->value.key.string;
485 }
486 }
487 else {
488 slot->kind = XS_SYMBOL_KIND;
489 slot->value.symbol = id;
490 }
491 }
492 else {
493 char buffer[16];
494 fxCopyStringC(the, slot, fxNumberToString(the, index, buffer, sizeof(buffer), 0, 0));
495 }
496}
497
498void fxIDToString(txMachine* the, txID id, txString theBuffer, txSize theSize)
499{

Callers 14

fx_Object_entriesFunction · 0.85
fx_Object_keysFunction · 0.85
fxProxyDefineOwnPropertyFunction · 0.85
fxProxyDeletePropertyFunction · 0.85
fxProxyGetOwnPropertyFunction · 0.85
fxProxyGetPropertyValueFunction · 0.85
fxProxyHasPropertyFunction · 0.85
fxProxySetPropertyValueFunction · 0.85
fx_Reflect_ownKeysFunction · 0.85

Calls 3

fxGetKeyFunction · 0.85
fxCopyStringCFunction · 0.85
fxNumberToStringFunction · 0.85

Tested by

no test coverage detected