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

Function builtinGetUnsignedInteger

modules/io/common/builtinCommon.c:199–211  ·  view source on GitHub ↗

standard converstion to unsigned integer but disallows undefined

Source from the content-addressed store, hash-verified

197
198// standard converstion to unsigned integer but disallows undefined
199uint32_t builtinGetUnsignedInteger(xsMachine *the, xsSlot *slot)
200{
201 xsIntegerValue value;
202 xsType type = fxTypeOf(the, slot);
203 if (xsUndefinedType == type)
204 xsUnknownError("invalid");
205
206 value = fxToInteger(the, slot);
207 if (value < 0)
208 xsRangeError("negative");
209
210 return (uint32_t)value;
211}
212
213#if defined(PICO_BUILD)
214void builtinInitIO()

Callers

nothing calls this directly

Calls 2

fxTypeOfFunction · 0.85
fxToIntegerFunction · 0.85

Tested by

no test coverage detected