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

Function fx_String

xs/sources/xsString.c:548–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

546}
547
548void fx_String(txMachine* the)
549{
550 txSlot* slot;
551 txSlot* instance;
552 if (mxArgc > 0) {
553 slot = mxArgv(0);
554 if (!mxHasTarget && (slot->kind == XS_SYMBOL_KIND)) {
555 fxSymbolToString(the, slot);
556 *mxResult = *slot;
557 return;
558 }
559 fxToString(the, slot);
560 }
561 else {
562 slot = &mxEmptyString;
563 }
564 if (!mxHasTarget) {
565 *mxResult = *slot;
566 return;
567 }
568 mxPushSlot(mxTarget);
569 fxGetPrototypeFromConstructor(the, &mxStringPrototype);
570 instance = fxNewStringInstance(the);
571 instance->next->kind = slot->kind; // @@
572 instance->next->value.key.string = slot->value.string;
573 mxPullSlot(mxResult);
574}
575
576#ifndef mxCESU8
577void fx_String_fromArrayBuffer(txMachine* the)

Callers

nothing calls this directly

Calls 4

fxSymbolToStringFunction · 0.85
fxToStringFunction · 0.85
fxNewStringInstanceFunction · 0.85

Tested by

no test coverage detected