MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / _writeInt32

Function _writeInt32

MathBox/mathbox-bundle.js:48402–48419  ·  view source on GitHub ↗
(buf, value, offset, littleEndian, noAssert)

Source from the content-addressed store, hash-verified

48400}
48401
48402function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
48403 if (!noAssert) {
48404 assert(value !== undefined && value !== null, 'missing value')
48405 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
48406 assert(offset !== undefined && offset !== null, 'missing offset')
48407 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
48408 verifsint(value, 0x7fffffff, -0x80000000)
48409 }
48410
48411 var len = buf.length
48412 if (offset >= len)
48413 return
48414
48415 if (value >= 0)
48416 _writeUInt32(buf, value, offset, littleEndian, noAssert)
48417 else
48418 _writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert)
48419}
48420
48421Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
48422 _writeInt32(this, value, offset, true, noAssert)

Callers 1

mathbox-bundle.jsFile · 0.70

Calls 3

assertFunction · 0.70
verifsintFunction · 0.70
_writeUInt32Function · 0.70

Tested by

no test coverage detected