]> zoso.dev Git - buffer.git/commitdiff
Fixes for PR #253 to increase browser compat
authorFeross Aboukhadijeh <feross@feross.org>
Tue, 27 Oct 2020 21:51:43 +0000 (11:51 -1000)
committerFeross Aboukhadijeh <feross@feross.org>
Tue, 27 Oct 2020 21:51:43 +0000 (11:51 -1000)
index.js

index f5a66e75e46dcbb71a80492f08a76514765af218..775a5143472253ee99f711d066083a08d060dbdc 100644 (file)
--- a/index.js
+++ b/index.js
@@ -266,7 +266,7 @@ function fromArrayLike (array) {
 
 function fromArrayView (arrayView) {
   if (isInstance(arrayView, Uint8Array)) {
-    var copy = Uint8Array.from(arrayView)
+    var copy = new Uint8Array(arrayView)
     return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)
   }
   return fromArrayLike(arrayView)