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

Function fxNewFunctionLength

xs/tools/xslSlot.c:511–529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511txSlot* fxNewFunctionLength(txMachine* the, txSlot* instance, txNumber length)
512{
513 txLinker* linker = (txLinker*)(the->context);
514 txSlot* property;
515 if (linker->stripFlag)
516 return C_NULL;
517 property = mxBehaviorGetProperty(the, instance, mxID(_length), 0, XS_OWN);
518 if (!property)
519 property = fxNextIntegerProperty(the, fxLastProperty(the, instance), 0, mxID(_length), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
520 if (length <= 0x7FFFFFFF) {
521 property->kind = XS_INTEGER_KIND;
522 property->value.integer = (txInteger)length;
523 }
524 else {
525 property->kind = XS_NUMBER_KIND;
526 property->value.number = length;
527 }
528 return property;
529}
530
531txSlot* fxNewFunctionName(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix)
532{

Callers

nothing calls this directly

Calls 2

fxNextIntegerPropertyFunction · 0.85
fxLastPropertyFunction · 0.85

Tested by

no test coverage detected