| 9740 | exports.kMaxLength = kMaxLength() |
| 9741 | |
| 9742 | function typedArraySupport () { |
| 9743 | try { |
| 9744 | var arr = new Uint8Array(1) |
| 9745 | arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} |
| 9746 | return arr.foo() === 42 && // typed array instances can be augmented |
| 9747 | typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` |
| 9748 | arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` |
| 9749 | } catch (e) { |
| 9750 | return false |
| 9751 | } |
| 9752 | } |
| 9753 | |
| 9754 | function kMaxLength () { |
| 9755 | return Buffer.TYPED_ARRAY_SUPPORT |