(that, length)
| 9758 | } |
| 9759 | |
| 9760 | function createBuffer (that, length) { |
| 9761 | if (kMaxLength() < length) { |
| 9762 | throw new RangeError('Invalid typed array length') |
| 9763 | } |
| 9764 | if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 9765 | // Return an augmented `Uint8Array` instance, for best performance |
| 9766 | that = new Uint8Array(length) |
| 9767 | that.__proto__ = Buffer.prototype |
| 9768 | } else { |
| 9769 | // Fallback: Return an object instance of the Buffer class |
| 9770 | if (that === null) { |
| 9771 | that = new Buffer(length) |
| 9772 | } |
| 9773 | that.length = length |
| 9774 | } |
| 9775 | |
| 9776 | return that |
| 9777 | } |
| 9778 | |
| 9779 | /** |
| 9780 | * The Buffer constructor returns instances of `Uint8Array` that have their |
no test coverage detected