_species-constructor.js 348 B

123456789
  1. // 7.3.20 SpeciesConstructor(O, defaultConstructor)
  2. var anObject = require('./_an-object');
  3. var aFunction = require('./_a-function');
  4. var SPECIES = require('./_wks')('species');
  5. module.exports = function (O, D) {
  6. var C = anObject(O).constructor;
  7. var S;
  8. return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
  9. };