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

Function fxNewFunctionLength

xs/sources/xsFunction.c:205–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203
204#ifndef mxLink
205txSlot* fxNewFunctionLength(txMachine* the, txSlot* instance, txNumber length)
206{
207 txSlot* property = mxBehaviorGetProperty(the, instance, mxID(_length), 0, XS_OWN);
208 if (!property)
209 property = fxNextIntegerProperty(the, fxLastProperty(the, instance), 0, mxID(_length), XS_DONT_ENUM_FLAG | XS_DONT_SET_FLAG);
210 if (length <= 0x7FFFFFFF) {
211 property->kind = XS_INTEGER_KIND;
212 property->value.integer = (txInteger)length;
213 }
214 else {
215 property->kind = XS_NUMBER_KIND;
216 property->value.number = length;
217 }
218 return property;
219}
220
221txSlot* fxNewFunctionName(txMachine* the, txSlot* instance, txID id, txIndex index, txID former, txString prefix)
222{

Callers

nothing calls this directly

Calls 2

fxNextIntegerPropertyFunction · 0.85
fxLastPropertyFunction · 0.85

Tested by

no test coverage detected