From: Feross Aboukhadijeh Date: Wed, 29 Oct 2014 04:13:18 +0000 (-0700) Subject: buf.constructor = Buffer X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=2d92ab6ac12016dd3e219aa5e114924762788ba1;p=buffer.git buf.constructor = Buffer Change made for https://github.com/hapijs/qs/issues/39#issuecomment-60427477 --- diff --git a/index.js b/index.js index bf25e09..03bce7a 100644 --- a/index.js +++ b/index.js @@ -906,6 +906,7 @@ var BP = Buffer.prototype * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods */ Buffer._augment = function (arr) { + arr.constructor = Buffer arr._isBuffer = true // save reference to original Uint8Array get/set methods before overwriting