From: Feross Aboukhadijeh Date: Wed, 20 Apr 2016 05:45:26 +0000 (-0700) Subject: check that ArrayBuffer.isView exists X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=b1dabee94ad07db0a4bcd99ce4f0283bbe80b5e6;p=buffer.git check that ArrayBuffer.isView exists For IE10 --- diff --git a/index.js b/index.js index 27f4fcd..12a7190 100644 --- a/index.js +++ b/index.js @@ -394,7 +394,7 @@ function byteLength (string, encoding) { if (Buffer.isBuffer(string)) { return string.length } - if (typeof ArrayBuffer !== 'undefined' && + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { return string.byteLength }