diff options
Diffstat (limited to 'node_modules/core-js/internals/species-constructor.js')
| -rw-r--r-- | node_modules/core-js/internals/species-constructor.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/node_modules/core-js/internals/species-constructor.js b/node_modules/core-js/internals/species-constructor.js new file mode 100644 index 0000000..4d8f565 --- /dev/null +++ b/node_modules/core-js/internals/species-constructor.js @@ -0,0 +1,13 @@ +var anObject = require('../internals/an-object'); +var aFunction = require('../internals/a-function'); +var wellKnownSymbol = require('../internals/well-known-symbol'); + +var SPECIES = wellKnownSymbol('species'); + +// `SpeciesConstructor` abstract operation +// https://tc39.github.io/ecma262/#sec-speciesconstructor +module.exports = function (O, defaultConstructor) { + var C = anObject(O).constructor; + var S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); +}; |
