From 753c064753a174455701cabd9e9feadff7fc768d Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 14 Apr 2020 15:29:46 -0700 Subject: [PATCH] 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 --- index.js | 11 ----------- 1 file changed, 11 deletions(-) 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) { -- 2.34.1