main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
606 bytes
|
Rev | Line | |
---|
[d24f17c] | 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 | // `SpeciesConstructor` abstract operation
|
---|
| 10 | // https://tc39.es/ecma262/#sec-speciesconstructor
|
---|
| 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 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.