| 112882 | */ Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); |
| 112883 | if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); |
| 112884 | function typedArraySupport() { |
| 112885 | // Can typed array instances can be augmented? |
| 112886 | try { |
| 112887 | var arr = new Uint8Array(1); |
| 112888 | var proto = { |
| 112889 | foo: function() { |
| 112890 | return 42; |
| 112891 | } |
| 112892 | }; |
| 112893 | Object.setPrototypeOf(proto, Uint8Array.prototype); |
| 112894 | Object.setPrototypeOf(arr, proto); |
| 112895 | return arr.foo() === 42; |
| 112896 | } catch (e) { |
| 112897 | return false; |
| 112898 | } |
| 112899 | } |
| 112900 | Object.defineProperty(Buffer.prototype, "parent", { |
| 112901 | enumerable: true, |
| 112902 | get: function() { |