| 743 | } |
| 744 | |
| 745 | void fx_Object_fromEntries(txMachine* the) |
| 746 | { |
| 747 | txSlot *instance, *iterator, *next, *value, *at; |
| 748 | if ((mxArgc < 1) || (mxArgv(0)->kind == XS_UNDEFINED_KIND) || (mxArgv(0)->kind == XS_NULL_KIND)) |
| 749 | mxTypeError("invalid iterable"); |
| 750 | mxPush(mxObjectPrototype); |
| 751 | instance = fxNewObjectInstance(the); |
| 752 | mxPullSlot(mxResult); |
| 753 | mxTemporary(iterator); |
| 754 | mxTemporary(next); |
| 755 | fxGetIterator(the, mxArgv(0), iterator, next, 0); |
| 756 | mxTemporary(value); |
| 757 | while (fxIteratorNext(the, iterator, next, value)) { |
| 758 | mxTry(the) { |
| 759 | if (value->kind != XS_REFERENCE_KIND) |
| 760 | mxTypeError("item: not an object"); |
| 761 | mxPushSlot(value); |
| 762 | mxGetIndex(0); |
| 763 | mxPushSlot(value); |
| 764 | mxGetIndex(1); |
| 765 | at = fxAt(the, the->stack + 1); |
| 766 | mxBehaviorDefineOwnProperty(the, instance, at->value.at.id, at->value.at.index, the->stack, XS_GET_ONLY); |
| 767 | mxPop(); |
| 768 | mxPop(); |
| 769 | } |
| 770 | mxCatch(the) { |
| 771 | fxIteratorReturn(the, iterator, 1); |
| 772 | fxJump(the); |
| 773 | } |
| 774 | } |
| 775 | mxPop(); |
| 776 | } |
| 777 | |
| 778 | void fx_Object_getOwnPropertyDescriptor(txMachine* the) |
| 779 | { |
nothing calls this directly
no test coverage detected