From: Feross Aboukhadijeh Date: Wed, 27 Jan 2016 14:37:50 +0000 (+0100) Subject: add back Buffer._augment for one more major version X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=e605d41d8102dce92603af7da8ad9a226a56fd8f;p=buffer.git add back Buffer._augment for one more major version It’s used by typedarray-to-buffer 3.0.4 and probably others. --- diff --git a/index.js b/index.js index bbb2eff..0f2ddbf 100644 --- a/index.js +++ b/index.js @@ -100,6 +100,12 @@ function Buffer (arg) { return fromObject(this, arg) } +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} + function fromNumber (that, length) { that = allocate(that, length < 0 ? 0 : checked(length) | 0) if (!Buffer.TYPED_ARRAY_SUPPORT) {