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

Function createBuffer

docs/app/js/sanddance-app.js:112914–112920  ·  view source on GitHub ↗
(length)

Source from the content-addressed store, hash-verified

112912 }
112913});
112914function createBuffer(length) {
112915 if (length > K_MAX_LENGTH) throw new RangeError('The value "' + length + '" is invalid for option "size"');
112916 // Return an augmented `Uint8Array` instance
112917 var buf = new Uint8Array(length);
112918 Object.setPrototypeOf(buf, Buffer.prototype);
112919 return buf;
112920}
112921/**
112922 * The Buffer constructor returns instances of `Uint8Array` that have their
112923 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of

Callers 5

allocFunction · 0.70
allocUnsafeFunction · 0.70
fromStringFunction · 0.70
fromArrayLikeFunction · 0.70
fromObjectFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected