aboutsummaryrefslogtreecommitdiff
path: root/node_modules/core-js/library/modules/es6.array.of.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/core-js/library/modules/es6.array.of.js')
-rw-r--r--node_modules/core-js/library/modules/es6.array.of.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/node_modules/core-js/library/modules/es6.array.of.js b/node_modules/core-js/library/modules/es6.array.of.js
new file mode 100644
index 00000000..b83e058c
--- /dev/null
+++ b/node_modules/core-js/library/modules/es6.array.of.js
@@ -0,0 +1,19 @@
+'use strict';
+var $export = require('./_export');
+var createProperty = require('./_create-property');
+
+// WebKit Array.of isn't generic
+$export($export.S + $export.F * require('./_fails')(function () {
+ function F() { /* empty */ }
+ return !(Array.of.call(F) instanceof F);
+}), 'Array', {
+ // 22.1.2.3 Array.of( ...items)
+ of: function of(/* ...args */) {
+ var index = 0;
+ var aLen = arguments.length;
+ var result = new (typeof this == 'function' ? this : Array)(aLen);
+ while (aLen > index) createProperty(result, index, arguments[index++]);
+ result.length = aLen;
+ return result;
+ }
+});