MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fx_JSON_stringify

Function fx_JSON_stringify

xs/sources/xsJSON.c:780–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780void 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
800void fxStringifyJSON(txMachine* the, txJSONStringifier* theStringifier)
801{

Callers

nothing calls this directly

Calls 4

fxStringifyJSONFunction · 0.85
fxStringifyJSONCharsFunction · 0.85
fxNewChunkFunction · 0.85
fxJumpFunction · 0.85

Tested by

no test coverage detected