]> git.r.bdr.sh - rbdr/dotfiles/blob
de72bc922911544b259d21da679ce88cfc42a10e
[rbdr/dotfiles] /
1 'use strict';
2
3 var isFunction = require('../../function/is-function')
4
5 , slice = Array.prototype.slice, defineProperty = Object.defineProperty
6 , desc = { configurable: true, enumerable: true, writable: true, value: null };
7
8 module.exports = function (/*…items*/) {
9 var result, i, l;
10 if (!this || (this === Array) || !isFunction(this)) return slice.call(arguments);
11 result = new this(l = arguments.length);
12 for (i = 0; i < l; ++i) {
13 desc.value = arguments[i];
14 defineProperty(result, i, desc);
15 }
16 desc.value = null;
17 result.length = l;
18 return result;
19 };