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

Function fx_Object_getOwnPropertySymbols

xs/sources/xsObject.c:847–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

845}
846
847void fx_Object_getOwnPropertySymbols(txMachine* the)
848{
849 txSlot* instance;
850 txSlot* result;
851 txSlot* array;
852 txSlot* item;
853 if ((mxArgc < 1) || (mxArgv(0)->kind == XS_UNDEFINED_KIND) || (mxArgv(0)->kind == XS_NULL_KIND))
854 mxTypeError("invalid object");
855 instance = fxToInstance(the, mxArgv(0));
856 mxPush(mxArrayPrototype);
857 result = fxNewArrayInstance(the);
858 mxPullSlot(mxResult);
859 array = result->next;
860 mxBehaviorOwnKeys(the, instance, XS_EACH_SYMBOL_FLAG, array);
861 item = array;
862 while ((item = item->next)) {
863 array->value.array.length++;
864 fxKeyAt(the, item->value.at.id, item->value.at.index, item);
865 }
866 fxCacheArray(the, result);
867}
868
869void fx_Object_getPrototypeOf(txMachine* the)
870{

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