X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fcore-js%2Flibrary%2Fmodules%2F_array-species-constructor.js;fp=node_modules%2Fcore-js%2Flibrary%2Fmodules%2F_array-species-constructor.js;h=a715389fd3bebad0c82f8727526e646b10e1379d;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/core-js/library/modules/_array-species-constructor.js b/node_modules/core-js/library/modules/_array-species-constructor.js new file mode 100644 index 000000000..a715389fd --- /dev/null +++ b/node_modules/core-js/library/modules/_array-species-constructor.js @@ -0,0 +1,16 @@ +var isObject = require('./_is-object') + , isArray = require('./_is-array') + , SPECIES = require('./_wks')('species'); + +module.exports = function(original){ + var C; + if(isArray(original)){ + C = original.constructor; + // cross-realm fallback + if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; + if(isObject(C)){ + C = C[SPECIES]; + if(C === null)C = undefined; + } + } return C === undefined ? Array : C; +}; \ No newline at end of file