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

Function fx_Object_getOwnPropertyDescriptor

xs/sources/xsObject.c:778–797  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776}
777
778void fx_Object_getOwnPropertyDescriptor(txMachine* the)
779{
780 txSlot* instance;
781 txSlot* at;
782 if ((mxArgc < 1) || (mxArgv(0)->kind == XS_UNDEFINED_KIND) || (mxArgv(0)->kind == XS_NULL_KIND))
783 mxTypeError("invalid object");
784 instance = fxToInstance(the, mxArgv(0));
785 if (mxArgc < 2)
786 mxPushUndefined();
787 else
788 mxPushSlot(mxArgv(1));
789 at = fxAt(the, the->stack);
790 mxPushUndefined();
791 if (mxBehaviorGetOwnProperty(the, instance, at->value.at.id, at->value.at.index, the->stack)) {
792 fxDescribeProperty(the, the->stack, XS_GET_ONLY);
793 mxPullSlot(mxResult);
794 }
795 mxPop();
796 mxPop();
797}
798
799void fx_Object_getOwnPropertyDescriptors(txMachine* the)
800{

Callers

nothing calls this directly

Calls 3

fxToInstanceFunction · 0.85
fxAtFunction · 0.85
fxDescribePropertyFunction · 0.85

Tested by

no test coverage detected