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

Function fx_Reflect_ownKeys

xs/sources/xsProxy.c:961–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

959}
960
961void fx_Reflect_ownKeys(txMachine* the)
962{
963 txSlot* result;
964 txSlot* array;
965 txSlot* item;
966 if ((mxArgc < 1) || (mxArgv(0)->kind != XS_REFERENCE_KIND))
967 mxTypeError("target: not an object");
968 mxPush(mxArrayPrototype);
969 result = fxNewArrayInstance(the);
970 mxPullSlot(mxResult);
971 array = result->next;
972 mxBehaviorOwnKeys(the, mxArgv(0)->value.reference, XS_EACH_NAME_FLAG | XS_EACH_SYMBOL_FLAG, array);
973 item = array;
974 while ((item = item->next)) {
975 array->value.array.length++;
976 fxKeyAt(the, item->value.at.id, item->value.at.index, item);
977 }
978 fxCacheArray(the, result);
979}
980
981void fx_Reflect_preventExtensions(txMachine* the)
982{

Callers

nothing calls this directly

Calls 3

fxNewArrayInstanceFunction · 0.85
fxKeyAtFunction · 0.85
fxCacheArrayFunction · 0.85

Tested by

no test coverage detected