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

Function fxConcatString

xs/sources/xsAll.c:208–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208txString fxConcatString(txMachine* the, txSlot* a, txSlot* b)
209{
210 txSize aSize = mxStringLength(a->value.string);
211 txSize bSize = mxStringLength(b->value.string);
212 txSize resultSize = fxAddChunkSizes(the, fxAddChunkSizes(the, aSize, bSize), 1);
213 txString result = (txString)fxNewChunk(the, resultSize);
214 c_memcpy(result, a->value.string, aSize);
215 c_memcpy(result + aSize, b->value.string, bSize + 1);
216 a->value.string = result;
217 a->kind = XS_STRING_KIND;
218 return result;
219}
220
221txString fxConcatStringC(txMachine* the, txSlot* a, txString b)
222{

Callers 14

fx_serializeURLFunction · 0.85
fx_serializeQueryFunction · 0.85
xsRun.cFile · 0.85
fx_GeneratorFunctionFunction · 0.85
fxSymbolToStringFunction · 0.85
fx_FunctionFunction · 0.85
fx_AsyncFunctionFunction · 0.85
fx_Error_toStringFunction · 0.85

Calls 1

fxNewChunkFunction · 0.85

Tested by

no test coverage detected