| 733 | } |
| 734 | |
| 735 | txBoolean fxProxySetPrototype(txMachine* the, txSlot* instance, txSlot* prototype) |
| 736 | { |
| 737 | txBoolean result; |
| 738 | mxProxyDeclarations(_setPrototypeOf); |
| 739 | if (function) { |
| 740 | /* THIS */ |
| 741 | mxPushSlot(handler); |
| 742 | /* FUNCTION */ |
| 743 | mxPushSlot(function); |
| 744 | mxCall(); |
| 745 | /* ARGUMENTS */ |
| 746 | mxPushSlot(target); |
| 747 | mxPushSlot(prototype); |
| 748 | mxRunCount(2); |
| 749 | result = fxToBoolean(the, the->stack); |
| 750 | mxPop(); |
| 751 | if (result) { |
| 752 | if (!mxBehaviorIsExtensible(the, target->value.reference)) { |
| 753 | mxPushUndefined(); |
| 754 | mxBehaviorGetPrototype(the, target->value.reference, the->stack); |
| 755 | if (!fxIsSameValue(the, prototype, the->stack, 0)) |
| 756 | mxTypeError("(proxy).setPrototypeOf: true for non-extensible object with different prototype"); |
| 757 | mxPop(); |
| 758 | } |
| 759 | } |
| 760 | } |
| 761 | else |
| 762 | result = mxBehaviorSetPrototype(the, target->value.reference, prototype); |
| 763 | mxProxyPop(); |
| 764 | return result; |
| 765 | } |
| 766 | |
| 767 | void fx_Proxy(txMachine* the) |
| 768 | { |
nothing calls this directly
no test coverage detected