UNPKG

666 BJavaScriptView Raw
1var fails = require('../internals/fails');
2var wellKnownSymbol = require('../internals/well-known-symbol');
3var V8_VERSION = require('../internals/v8-version');
4
5var SPECIES = wellKnownSymbol('species');
6
7module.exports = function (METHOD_NAME) {
8 // We can't use this feature detection in V8 since it causes
9 // deoptimization and serious performance degradation
10 // https://github.com/zloirock/core-js/issues/677
11 return V8_VERSION >= 51 || !fails(function () {
12 var array = [];
13 var constructor = array.constructor = {};
14 constructor[SPECIES] = function () {
15 return { foo: 1 };
16 };
17 return array[METHOD_NAME](Boolean).foo !== 1;
18 });
19};