| 539 | } |
| 540 | |
| 541 | void fxBuildHosts(txMachine* the, txInteger c, const txHostFunctionBuilder* builder) |
| 542 | { |
| 543 | mxPushInteger(c); |
| 544 | mxPushInteger(1); |
| 545 | mxPush(mxArrayPrototype); |
| 546 | fxNewArrayInstance(the); |
| 547 | fxArrayCacheBegin(the, the->stack); |
| 548 | while (c) { |
| 549 | if (builder->length >= 0) { |
| 550 | #if mxHostFunctionPrimitive |
| 551 | mxPushUndefined(); |
| 552 | the->stack->kind = XS_HOST_FUNCTION_KIND; |
| 553 | the->stack->value.hostFunction.builder = builder; |
| 554 | the->stack->value.hostFunction.profileID = the->profileID; |
| 555 | the->profileID++; |
| 556 | #else |
| 557 | fxNewHostFunction(the, builder->callback, builder->length, builder->id, XS_NO_ID); |
| 558 | #endif |
| 559 | } |
| 560 | else |
| 561 | fxNewHostObject(the, (txDestructor)builder->callback); |
| 562 | fxArrayCacheItem(the, the->stack + 1, the->stack); |
| 563 | mxPop(); |
| 564 | c--; |
| 565 | builder++; |
| 566 | } |
| 567 | fxArrayCacheEnd(the, the->stack); |
| 568 | } |
| 569 | |
| 570 | txSlot* fxNewHostConstructor(txMachine* the, txCallback theCallback, txInteger theLength, txInteger name) |
| 571 | { |
nothing calls this directly
no test coverage detected