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 |
|
7 | var SPECIES = wellKnownSymbol('species');
|
8 |
|
9 |
|
10 |
|
11 | module.exports = function (O, defaultConstructor) {
|
12 | var C = anObject(O).constructor;
|
13 | var S;
|
14 | return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
|
15 | };
|