From e93da8b04da86773247aadb1cbb1912e4f4526b2 Mon Sep 17 00:00:00 2001 From: Priyansh Date: Tue, 22 Dec 2020 17:49:59 +0530 Subject: Rewriting Project --- .../internals/array-method-has-species-support.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 node_modules/core-js/internals/array-method-has-species-support.js (limited to 'node_modules/core-js/internals/array-method-has-species-support.js') diff --git a/node_modules/core-js/internals/array-method-has-species-support.js b/node_modules/core-js/internals/array-method-has-species-support.js new file mode 100644 index 0000000..0d5d380 --- /dev/null +++ b/node_modules/core-js/internals/array-method-has-species-support.js @@ -0,0 +1,19 @@ +var fails = require('../internals/fails'); +var wellKnownSymbol = require('../internals/well-known-symbol'); +var V8_VERSION = require('../internals/engine-v8-version'); + +var SPECIES = wellKnownSymbol('species'); + +module.exports = function (METHOD_NAME) { + // We can't use this feature detection in V8 since it causes + // deoptimization and serious performance degradation + // https://github.com/zloirock/core-js/issues/677 + return V8_VERSION >= 51 || !fails(function () { + var array = []; + var constructor = array.constructor = {}; + constructor[SPECIES] = function () { + return { foo: 1 }; + }; + return array[METHOD_NAME](Boolean).foo !== 1; + }); +}; -- cgit v1.2.3