.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / core-js / modules / es.array.of.js
1 'use strict';
2 var $ = require('../internals/export');
3 var fails = require('../internals/fails');
4 var createProperty = require('../internals/create-property');
5
6 var ISNT_GENERIC = fails(function () {
7   function F() { /* empty */ }
8   return !(Array.of.call(F) instanceof F);
9 });
10
11 // `Array.of` method
12 // https://tc39.es/ecma262/#sec-array.of
13 // WebKit Array.of isn't generic
14 $({ target: 'Array', stat: true, forced: ISNT_GENERIC }, {
15   of: function of(/* ...args */) {
16     var index = 0;
17     var argumentsLength = arguments.length;
18     var result = new (typeof this == 'function' ? this : Array)(argumentsLength);
19     while (argumentsLength > index) createProperty(result, index, arguments[index++]);
20     result.length = argumentsLength;
21     return result;
22   }
23 });