MCPcopy Create free account
hub / github.com/microsoft/SandDance / assertSize

Function assertSize

docs/tests/v2/es6/js/sanddance.js:78535–78541  ·  view source on GitHub ↗
(size)

Source from the content-addressed store, hash-verified

78533}
78534
78535function assertSize (size) {
78536 if (typeof size !== 'number') {
78537 throw new TypeError('"size" argument must be a number')
78538 } else if (size < 0) {
78539 throw new RangeError('"size" argument must not be negative')
78540 }
78541}
78542
78543function alloc (that, size, fill, encoding) {
78544 assertSize(size)

Callers 2

allocFunction · 0.70
allocUnsafeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected