]> zoso.dev Git - buffer.git/commitdiff
Fix new buffer from buffer test for Object implementation
authorFeross Aboukhadijeh <feross@feross.org>
Thu, 9 Jan 2014 04:57:32 +0000 (20:57 -0800)
committerFeross Aboukhadijeh <feross@feross.org>
Thu, 9 Jan 2014 04:57:32 +0000 (20:57 -0800)
index.js

index 7124b1a3bd2fa75723cdd131d3084c2fc55f6ee7..5d1d4be94930bda51d20e543406c81eecd22093c 100644 (file)
--- a/index.js
+++ b/index.js
@@ -81,7 +81,7 @@ function Buffer (subject, encoding, noZero) {
   }
 
   var i
-  if (Buffer.isBuffer(subject)) {
+  if (subject instanceof Uint8Array) {
     // Speed optimization -- use set if we're copying from a Uint8Array
     buf.set(subject)
   } else if (isArrayish(subject)) {