| 558 | } |
| 559 | |
| 560 | txSlot* fxNextHostAccessorProperty(txMachine* the, txSlot* property, txCallback get, txCallback set, txID id, txFlag flag) |
| 561 | { |
| 562 | txLinker* linker = (txLinker*)(the->context); |
| 563 | txSlot *getter = NULL, *setter = NULL, *home = the->stack, *slot; |
| 564 | if (get) { |
| 565 | fxNewLinkerBuilder(linker, get, 0, id); |
| 566 | getter = fxNewHostFunction(the, get, 0, XS_NO_ID, XS_NO_ID); |
| 567 | slot = mxFunctionInstanceHome(getter); |
| 568 | slot->value.home.object = home->value.reference; |
| 569 | fxRenameFunction(the, getter, id, 0, XS_NO_ID, "get "); |
| 570 | } |
| 571 | if (set) { |
| 572 | fxNewLinkerBuilder(linker, set, 1, id); |
| 573 | setter = fxNewHostFunction(the, set, 1, XS_NO_ID, XS_NO_ID); |
| 574 | slot = mxFunctionInstanceHome(setter); |
| 575 | slot->value.home.object = home->value.reference; |
| 576 | fxRenameFunction(the, setter, id, 0, XS_NO_ID, "set "); |
| 577 | } |
| 578 | property = property->next = fxNewSlot(the); |
| 579 | property->flag = flag; |
| 580 | property->ID = id; |
| 581 | property->kind = XS_ACCESSOR_KIND; |
| 582 | property->value.accessor.getter = getter; |
| 583 | property->value.accessor.setter = setter; |
| 584 | if (set) |
| 585 | mxPop(); |
| 586 | if (get) |
| 587 | mxPop(); |
| 588 | return property; |
| 589 | } |
| 590 | |
| 591 | txSlot* fxNextHostFunctionProperty(txMachine* the, txSlot* property, txCallback call, txInteger length, txID id, txFlag flag) |
| 592 | { |
nothing calls this directly
no test coverage detected