X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;ds=sidebyside;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Fcore-js%2Finternals%2Fcollection-from.js;h=748714b1d1e6f40b439bcf3b08a0580acebf9e84;hb=3be0a9efc698a9570a44456009afc6014812625a;hp=3bcf671bb5d9915983389c2cba880d7989b59880;hpb=d2f432cc757f42f0318fdddcab8c00b240d47088;p=dotfiles%2F.git diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/collection-from.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/collection-from.js index 3bcf671b..748714b1 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/collection-from.js +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/core-js/internals/collection-from.js @@ -1,26 +1,30 @@ 'use strict'; // https://tc39.github.io/proposal-setmap-offrom/ -var aFunction = require('../internals/a-function'); var bind = require('../internals/function-bind-context'); +var call = require('../internals/function-call'); +var aCallable = require('../internals/a-callable'); +var aConstructor = require('../internals/a-constructor'); var iterate = require('../internals/iterate'); +var push = [].push; + module.exports = function from(source /* , mapFn, thisArg */) { var length = arguments.length; var mapFn = length > 1 ? arguments[1] : undefined; var mapping, array, n, boundFunction; - aFunction(this); + aConstructor(this); mapping = mapFn !== undefined; - if (mapping) aFunction(mapFn); + if (mapping) aCallable(mapFn); if (source == undefined) return new this(); array = []; if (mapping) { n = 0; - boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined, 2); + boundFunction = bind(mapFn, length > 2 ? arguments[2] : undefined); iterate(source, function (nextItem) { - array.push(boundFunction(nextItem, n++)); + call(push, array, boundFunction(nextItem, n++)); }); } else { - iterate(source, array.push, { that: array }); + iterate(source, push, { that: array }); } return new this(array); };