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

Function fxNewFunctionName

xs/tools/xslSlot.c:531–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

529}
530
531txSlot* fxNewFunctionName(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix)
532{
533 txLinker* linker = (txLinker*)(the->context);
534 txSlot* property;
535 if (linker->stripFlag)
536 return C_NULL;
537 property = mxBehaviorGetProperty(the, instance, mxID(_name), 0, XS_OWN);
538 if (property) {
539 if ((property->kind != mxEmptyString.kind) || (property->value.string != mxEmptyString.value.string))
540 return property;
541 }
542 else
543 property = fxNextSlotProperty(the, fxLastProperty(the, instance), &mxEmptyString, mxID(_name), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
544 if (id != XS_NO_ID) {
545 txBoolean adorn;
546 fxPushKeyString(the, id, &adorn);
547 mxPullSlot(property);
548 if (adorn)
549 fxAdornStringC(the, "[", property, "]");
550 }
551 else if (former) {
552 char buffer[16];
553 fxCopyStringC(the, property, fxNumberToString(the, index, buffer, sizeof(buffer), 0, 0));
554 }
555 if (prefix)
556 fxAdornStringC(the, prefix, property, C_NULL);
557 return property;
558}
559
560txSlot* fxNextHostAccessorProperty(txMachine* the, txSlot* property, txCallback get, txCallback set, txID id, txFlag flag)
561{

Callers

nothing calls this directly

Calls 6

fxNextSlotPropertyFunction · 0.85
fxLastPropertyFunction · 0.85
fxPushKeyStringFunction · 0.85
fxAdornStringCFunction · 0.85
fxCopyStringCFunction · 0.85
fxNumberToStringFunction · 0.85

Tested by

no test coverage detected