From: Feross Aboukhadijeh Date: Wed, 11 Dec 2013 03:56:16 +0000 (-0800) Subject: don't assume existence of Uint8Array X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=03ace8ccaa3305ccad4303c7890e41c7c1e2bf24;p=buffer.git don't assume existence of Uint8Array --- diff --git a/index.js b/index.js index 76564ef..7edee49 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,7 @@ var xUint8Array = typeof Uint8Array === 'undefined' */ var browserSupport = (function () { try { - var arr = new Uint8Array(0) + var arr = new xUint8Array(0) arr.foo = function () { return 42 } return 42 === arr.foo() } catch (e) { @@ -34,7 +34,7 @@ var browserSupport = (function () { * since they don't support Proxy. Without that, it is not possible to augment * native Uint8Array instances in Firefox. */ -if (xUint8Array === Uint8Array && !browserSupport) { +if (xUint8Array !== TA.Uint8Array && !browserSupport) { xDataView = TA.DataView xArrayBuffer = TA.ArrayBuffer xUint8Array = TA.Uint8Array