From: Feross Aboukhadijeh Date: Tue, 14 Apr 2020 22:29:46 +0000 (-0700) Subject: Remove unneeded Symbol.species code X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=753c064753a174455701cabd9e9feadff7fc768d;p=buffer.git Remove unneeded Symbol.species code We now handle calls like: new Buffer(arraybuffer, 2, 8) so there's no need for this workaround originally implemented in: https://github.com/feross/buffer/pull/97 More info: https://bugs.chromium.org/p/v8/issues/detail?id=4665#c4 Fixes #260. Supersedes #261 --- diff --git a/index.js b/index.js index 4ec5595..e87bfaa 100644 --- a/index.js +++ b/index.js @@ -108,17 +108,6 @@ function Buffer (arg, encodingOrOffset, length) { return from(arg, encodingOrOffset, length) } -// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 -if (typeof Symbol !== 'undefined' && Symbol.species != null && - Buffer[Symbol.species] === Buffer) { - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true, - enumerable: false, - writable: false - }) -} - Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) {