| 78420 | exports.kMaxLength = kMaxLength() |
| 78421 | |
| 78422 | function typedArraySupport () { |
| 78423 | try { |
| 78424 | var arr = new Uint8Array(1) |
| 78425 | arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} |
| 78426 | return arr.foo() === 42 && // typed array instances can be augmented |
| 78427 | typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` |
| 78428 | arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` |
| 78429 | } catch (e) { |
| 78430 | return false |
| 78431 | } |
| 78432 | } |
| 78433 | |
| 78434 | function kMaxLength () { |
| 78435 | return Buffer.TYPED_ARRAY_SUPPORT |