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

Function fxMeasureThrow

xs/sources/xsMarshall.c:1010–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008}
1009
1010void fxMeasureThrow(txMachine* the, txMarshallBuffer* theBuffer, txString message)
1011{
1012 txSlot* slot = theBuffer->stack;
1013 txInteger i = 0;
1014 txInteger c = sizeof(theBuffer->error);
1015 i += c_snprintf(theBuffer->error, c, "marshall ");
1016 while (slot > the->stack) {
1017 slot--;
1018 if (slot->kind == XS_AT_KIND) {
1019 if (slot->value.at.id != XS_NO_ID) {
1020 txBoolean adorn;
1021 txString string = fxGetKeyString(the, slot->value.at.id, &adorn);
1022 if (adorn) {
1023 if (i < c) i += c_snprintf(theBuffer->error + i, c - i, "[%s]", string);
1024 }
1025 else {
1026 if (i < c) i += c_snprintf(theBuffer->error + i, c - i, ".%s", string);
1027 }
1028 }
1029 else {
1030 if (i < c) i += c_snprintf(theBuffer->error + i, c - i, "[%d]", (int)slot->value.at.index);
1031 }
1032 }
1033 }
1034 if (i < c)
1035 i += c_snprintf(theBuffer->error + i, c - i, ": %s", message);
1036 c_longjmp(theBuffer->jmp_buf, 1);
1037}
1038

Callers 4

fxMarshallFunction · 0.85
fxMeasureChunkFunction · 0.85
fxMeasureReferenceFunction · 0.85
fxMeasureSlotFunction · 0.85

Calls 1

fxGetKeyStringFunction · 0.85

Tested by

no test coverage detected