wallet-core/node_modules/core-js/modules/es6.array.of.js

19 lines
599 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
'use strict';
2017-05-27 17:36:13 +02:00
var $export = require('./_export')
, createProperty = require('./_create-property');
2016-10-10 03:43:44 +02:00
// WebKit Array.of isn't generic
2017-05-27 17:36:13 +02:00
$export($export.S + $export.F * require('./_fails')(function(){
2016-10-10 03:43:44 +02:00
function F(){}
return !(Array.of.call(F) instanceof F);
}), 'Array', {
// 22.1.2.3 Array.of( ...items)
of: function of(/* ...args */){
var index = 0
2017-05-27 17:36:13 +02:00
, aLen = arguments.length
, result = new (typeof this == 'function' ? this : Array)(aLen);
while(aLen > index)createProperty(result, index, arguments[index++]);
result.length = aLen;
2016-10-10 03:43:44 +02:00
return result;
}
});