"Fossies" - the Fresh Open Source Software Archive

Member "Atom/resources/app/apm/node_modules/es5-ext/array/of/shim.js" (8 Mar 2017, 568 Bytes) of archive /windows/misc/atom-windows.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Javascript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    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 };