From: Yusuke Kawasaki Date: Sat, 18 Jun 2016 17:40:08 +0000 (+0900) Subject: re #121: IE10-on-IE11 fails the augmentation X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=23548e783023cc454b1e2634d68b63da311c5d72;p=buffer.git re #121: IE10-on-IE11 fails the augmentation --- diff --git a/index.js b/index.js index e229ee8..933a972 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ exports.kMaxLength = kMaxLength() function typedArraySupport () { try { var arr = new Uint8Array(1) - arr.foo = function () { return 42 } + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} return arr.foo() === 42 && // typed array instances can be augmented typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`