debian-mirror-gitlab/core-js/internals/array-method-has-species-support.js
2019-09-25 13:30:05 +05:30

15 lines
422 B
JavaScript

var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
var SPECIES = wellKnownSymbol('species');
module.exports = function (METHOD_NAME) {
return !fails(function () {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};