aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/library/modules/$.species-constructor.js
blob: f71168b77dd9afc1069b11c72baab01c5ea967c3 (plain)
1
2
3
4
5
6
7
8
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
var anObject  = require('./$.an-object')
  , aFunction = require('./$.a-function')
  , SPECIES   = require('./$.wks')('species');
module.exports = function(O, D){
  var C = anObject(O).constructor, S;
  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};