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

Function fxNewFunctionName

xs/sources/xsFunction.c:221–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221txSlot* fxNewFunctionName(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix)
222{
223 txSlot* property;
224 property = mxBehaviorGetProperty(the, instance, mxID(_name), 0, XS_OWN);
225 if (property) {
226 if ((property->kind != mxEmptyString.kind) || (property->value.string != mxEmptyString.value.string))
227 return property;
228 }
229 else
230 property = fxNextSlotProperty(the, fxLastProperty(the, instance), &mxEmptyString, mxID(_name), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
231 if (id != XS_NO_ID) {
232 txBoolean adorn;
233 fxPushKeyString(the, id, &adorn);
234 mxPullSlot(property);
235 if (adorn)
236 fxAdornStringC(the, "[", property, "]");
237 }
238 else if (former) {
239 char buffer[16];
240 fxCopyStringC(the, property, fxNumberToString(the, index, buffer, sizeof(buffer), 0, 0));
241 }
242 if (prefix)
243 fxAdornStringC(the, prefix, property, C_NULL);
244 return property;
245}
246#endif
247
248void fxRenameFunction(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix)

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