MES手机端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
606 B

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