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

Function fx_Object_defineProperty

xs/sources/xsObject.c:590–605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588}
589
590void fx_Object_defineProperty(txMachine* the)
591{
592 txSlot* at;
593 txFlag mask;
594 if ((mxArgc < 1) || (mxArgv(0)->kind != XS_REFERENCE_KIND))
595 mxTypeError("invalid object");
596 if (mxArgc < 2)
597 mxTypeError("invalid key");
598 at = fxAt(the, mxArgv(1));
599 if ((mxArgc < 3) || (mxArgv(2)->kind != XS_REFERENCE_KIND))
600 mxTypeError("invalid descriptor");
601 mask = fxDescriptorToSlot(the, mxArgv(2));
602 if (!mxBehaviorDefineOwnProperty(the, mxArgv(0)->value.reference, at->value.at.id, at->value.at.index, mxArgv(2), mask))
603 mxTypeError("invalid descriptor");
604 *mxResult = *mxArgv(0);
605}
606
607void fx_Object_entries(txMachine* the)
608{

Callers

nothing calls this directly

Calls 2

fxAtFunction · 0.85
fxDescriptorToSlotFunction · 0.85

Tested by

no test coverage detected