1 | var anObject = require('../internals/an-object');
|
2 | var aFunction = require('../internals/a-function');
|
3 | var wellKnownSymbol = require('../internals/well-known-symbol');
|
4 |
|
5 | var SPECIES = wellKnownSymbol('species');
|
6 |
|
7 | // `SpeciesConstructor` abstract operation
|
8 | // https://tc39.github.io/ecma262/#sec-speciesconstructor
|
9 | module.exports = function (O, defaultConstructor) {
|
10 | var C = anObject(O).constructor;
|
11 | var S;
|
12 | return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S);
|
13 | };
|