| 724 | } |
| 725 | |
| 726 | void fx_AsyncFunction(txMachine* the) |
| 727 | { |
| 728 | txInteger c, i; |
| 729 | txStringStream stream; |
| 730 | txSlot* module = mxFunctionInstanceHome(mxFunction->value.reference)->value.home.module; |
| 731 | if (!module) module = mxProgram.value.reference; |
| 732 | |
| 733 | c = mxArgc; |
| 734 | i = 0; |
| 735 | mxPushStringX("(async function anonymous("); |
| 736 | while (c > 1) { |
| 737 | fxToString(the, mxArgv(i)); |
| 738 | fxConcatString(the, the->stack, mxArgv(i)); |
| 739 | if (c > 2) |
| 740 | fxConcatStringC(the, the->stack, ", "); |
| 741 | c--; |
| 742 | i++; |
| 743 | } |
| 744 | fxConcatStringC(the, the->stack, "\n){"); |
| 745 | if (c > 0) { |
| 746 | fxToString(the, mxArgv(i)); |
| 747 | fxConcatString(the, the->stack, mxArgv(i)); |
| 748 | } |
| 749 | fxConcatStringC(the, the->stack, "\n})"); |
| 750 | stream.slot = the->stack; |
| 751 | stream.offset = 0; |
| 752 | stream.size = mxStringLength(the->stack->value.string); |
| 753 | fxRunScript(the, fxParseScript(the, &stream, fxStringGetter, mxProgramFlag | mxFunctionFlag), C_NULL, C_NULL, C_NULL, C_NULL, module); |
| 754 | mxPullSlot(mxResult); |
| 755 | if (mxHasTarget && !fxIsSameSlot(the, mxTarget, mxFunction)) { |
| 756 | mxPushSlot(mxTarget); |
| 757 | fxGetPrototypeFromConstructor(the, &mxAsyncFunctionPrototype); |
| 758 | mxResult->value.reference->value.instance.prototype = the->stack->value.reference; |
| 759 | mxPop(); |
| 760 | } |
| 761 | } |
nothing calls this directly
no test coverage detected