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

Function fx_Object_getOwnPropertyNames

xs/sources/xsObject.c:825–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

823}
824
825void fx_Object_getOwnPropertyNames(txMachine* the)
826{
827 txSlot* instance;
828 txSlot* result;
829 txSlot* array;
830 txSlot* item;
831 if ((mxArgc < 1) || (mxArgv(0)->kind == XS_UNDEFINED_KIND) || (mxArgv(0)->kind == XS_NULL_KIND))
832 mxTypeError("invalid object");
833 instance = fxToInstance(the, mxArgv(0));
834 mxPush(mxArrayPrototype);
835 result = fxNewArrayInstance(the);
836 mxPullSlot(mxResult);
837 array = result->next;
838 mxBehaviorOwnKeys(the, instance, XS_EACH_NAME_FLAG, array);
839 item = array;
840 while ((item = item->next)) {
841 array->value.array.length++;
842 fxKeyAt(the, item->value.at.id, item->value.at.index, item);
843 }
844 fxCacheArray(the, result);
845}
846
847void fx_Object_getOwnPropertySymbols(txMachine* the)
848{

Callers

nothing calls this directly

Calls 4

fxToInstanceFunction · 0.85
fxNewArrayInstanceFunction · 0.85
fxKeyAtFunction · 0.85
fxCacheArrayFunction · 0.85

Tested by

no test coverage detected