| 778 | } |
| 779 | |
| 780 | void fx_JSON_stringify(txMachine* the) |
| 781 | { |
| 782 | volatile txJSONStringifier aStringifier = {0}; |
| 783 | mxTry(the) { |
| 784 | fxStringifyJSON(the, (txJSONStringifier*)&aStringifier); |
| 785 | if (aStringifier.offset) { |
| 786 | fxStringifyJSONChars(the, (txJSONStringifier*)&aStringifier, "\0", 1); |
| 787 | mxResult->value.string = (txString)fxNewChunk(the, aStringifier.offset); |
| 788 | c_memcpy(mxResult->value.string, aStringifier.buffer, aStringifier.offset); |
| 789 | mxResult->kind = XS_STRING_KIND; |
| 790 | } |
| 791 | c_free(aStringifier.buffer); |
| 792 | } |
| 793 | mxCatch(the) { |
| 794 | if (aStringifier.buffer) |
| 795 | c_free(aStringifier.buffer); |
| 796 | fxJump(the); |
| 797 | } |
| 798 | } |
| 799 | |
| 800 | void fxStringifyJSON(txMachine* the, txJSONStringifier* theStringifier) |
| 801 | { |
nothing calls this directly
no test coverage detected