]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/array/generate.js
5e066750b1d5baa420ac457830317654cf34493d
3 var toPosInt
= require('../number/to-pos-integer')
4 , value
= require('../object/valid-value')
6 , slice
= Array
.prototype.slice
;
8 module
.exports = function (length
/*, …fill*/) {
10 length
= toPosInt(value(length
));
11 if (length
=== 0) return [];
13 arr
= (arguments
.length
< 2) ? [undefined] :
14 slice
.call(arguments
, 1, 1 + length
);
16 while ((l
= arr
.length
) < length
) {
17 arr
= arr
.concat(arr
.slice(0, length
- l
));