MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / checkInt

Function checkInt

src/runtime_debug.js:243–247  ·  view source on GitHub ↗
(value, bits, min, max)

Source from the content-addressed store, hash-verified

241var MIN_INT64 = - (2 ** (64 - 1));
242
243function checkInt(value, bits, min, max) {
244 assert(Number.isInteger(Number(value)), `attempt to write non-integer (${value}) into integer heap`);
245 assert(value <= max, `value (${value}) too large to write as ${bits}-bit value`);
246 assert(value >= min, `value (${value}) too small to write as ${bits}-bit value`);
247}
248
249var checkInt1 = (value) => checkInt(value, 1, 1);
250var checkInt8 = (value) => checkInt(value, 8, MIN_INT8, MAX_UINT8);

Callers 6

checkInt1Function · 0.85
checkInt8Function · 0.85
checkInt16Function · 0.85
checkInt32Function · 0.85
checkInt53Function · 0.85
checkInt64Function · 0.85

Calls 1

assertFunction · 0.70

Tested by

no test coverage detected