(that, length)
| 45769 | } |
| 45770 | |
| 45771 | function createBuffer(that, length) { |
| 45772 | if (kMaxLength() < length) { |
| 45773 | throw new RangeError('Invalid typed array length'); |
| 45774 | } |
| 45775 | if (Buffer.TYPED_ARRAY_SUPPORT) { |
| 45776 | // Return an augmented `Uint8Array` instance, for best performance |
| 45777 | that = new Uint8Array(length); |
| 45778 | that.__proto__ = Buffer.prototype; |
| 45779 | } else { |
| 45780 | // Fallback: Return an object instance of the Buffer class |
| 45781 | if (that === null) { |
| 45782 | that = new Buffer(length); |
| 45783 | } |
| 45784 | that.length = length; |
| 45785 | } |
| 45786 | |
| 45787 | return that; |
| 45788 | } |
| 45789 | |
| 45790 | /** |
| 45791 | * The Buffer constructor returns instances of `Uint8Array` that have their |
no test coverage detected