massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / internals / array-slice-simple.js
1 var global = require('../internals/global');
2 var toAbsoluteIndex = require('../internals/to-absolute-index');
3 var lengthOfArrayLike = require('../internals/length-of-array-like');
4 var createProperty = require('../internals/create-property');
5
6 var Array = global.Array;
7 var max = Math.max;
8
9 module.exports = function (O, start, end) {
10   var length = lengthOfArrayLike(O);
11   var k = toAbsoluteIndex(start, length);
12   var fin = toAbsoluteIndex(end === undefined ? length : end, length);
13   var result = Array(max(fin - k, 0));
14   for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
15   result.length = n;
16   return result;
17 };