OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var AddIndexedProperty; | 14 var AddIndexedProperty; |
15 var Delete; | 15 var Delete; |
16 var FLAG_harmony_tolength; | 16 var FLAG_harmony_tolength; |
| 17 var GetIterator; |
| 18 var GetMethod; |
17 var GlobalArray = global.Array; | 19 var GlobalArray = global.Array; |
18 var InternalArray = utils.InternalArray; | 20 var InternalArray = utils.InternalArray; |
19 var InternalPackedArray = utils.InternalPackedArray; | 21 var InternalPackedArray = utils.InternalPackedArray; |
20 var MakeTypeError; | 22 var MakeTypeError; |
| 23 var MaxSimple; |
21 var MinSimple; | 24 var MinSimple; |
| 25 var ObjectDefineProperty; |
22 var ObjectHasOwnProperty; | 26 var ObjectHasOwnProperty; |
23 var ObjectIsFrozen; | 27 var ObjectIsFrozen; |
24 var ObjectIsSealed; | 28 var ObjectIsSealed; |
25 var ObjectToString; | 29 var ObjectToString; |
26 var ObserveBeginPerformSplice; | 30 var ObserveBeginPerformSplice; |
27 var ObserveEndPerformSplice; | 31 var ObserveEndPerformSplice; |
28 var ObserveEnqueueSpliceRecord; | 32 var ObserveEnqueueSpliceRecord; |
| 33 var iteratorSymbol = utils.ImportNow("iterator_symbol"); |
29 var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); | 34 var unscopablesSymbol = utils.ImportNow("unscopables_symbol"); |
30 | 35 |
31 utils.Import(function(from) { | 36 utils.Import(function(from) { |
32 AddIndexedProperty = from.AddIndexedProperty; | 37 AddIndexedProperty = from.AddIndexedProperty; |
33 Delete = from.Delete; | 38 Delete = from.Delete; |
| 39 GetIterator = from.GetIterator; |
| 40 GetMethod = from.GetMethod; |
34 MakeTypeError = from.MakeTypeError; | 41 MakeTypeError = from.MakeTypeError; |
| 42 MaxSimple = from.MaxSimple; |
35 MinSimple = from.MinSimple; | 43 MinSimple = from.MinSimple; |
| 44 ObjectDefineProperty = from.ObjectDefineProperty; |
36 ObjectHasOwnProperty = from.ObjectHasOwnProperty; | 45 ObjectHasOwnProperty = from.ObjectHasOwnProperty; |
37 ObjectIsFrozen = from.ObjectIsFrozen; | 46 ObjectIsFrozen = from.ObjectIsFrozen; |
38 ObjectIsSealed = from.ObjectIsSealed; | 47 ObjectIsSealed = from.ObjectIsSealed; |
39 ObjectToString = from.ObjectToString; | 48 ObjectToString = from.ObjectToString; |
40 ObserveBeginPerformSplice = from.ObserveBeginPerformSplice; | 49 ObserveBeginPerformSplice = from.ObserveBeginPerformSplice; |
41 ObserveEndPerformSplice = from.ObserveEndPerformSplice; | 50 ObserveEndPerformSplice = from.ObserveEndPerformSplice; |
42 ObserveEnqueueSpliceRecord = from.ObserveEnqueueSpliceRecord; | 51 ObserveEnqueueSpliceRecord = from.ObserveEnqueueSpliceRecord; |
43 }); | 52 }); |
44 | 53 |
45 utils.ImportFromExperimental(function(from) { | 54 utils.ImportFromExperimental(function(from) { |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 if (%_Call(f, receiver, element, i, array)) { | 1221 if (%_Call(f, receiver, element, i, array)) { |
1213 accumulator[accumulator_length++] = element; | 1222 accumulator[accumulator_length++] = element; |
1214 } | 1223 } |
1215 } | 1224 } |
1216 } | 1225 } |
1217 var result = new GlobalArray(); | 1226 var result = new GlobalArray(); |
1218 %MoveArrayContents(accumulator, result); | 1227 %MoveArrayContents(accumulator, result); |
1219 return result; | 1228 return result; |
1220 } | 1229 } |
1221 | 1230 |
| 1231 |
1222 function ArrayFilter(f, receiver) { | 1232 function ArrayFilter(f, receiver) { |
1223 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.filter"); | 1233 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.filter"); |
1224 | 1234 |
1225 // Pull out the length so that modifications to the length in the | 1235 // Pull out the length so that modifications to the length in the |
1226 // loop will not affect the looping and side effects are visible. | 1236 // loop will not affect the looping and side effects are visible. |
1227 var array = TO_OBJECT(this); | 1237 var array = TO_OBJECT(this); |
1228 var length = TO_LENGTH_OR_UINT32(array.length); | 1238 var length = TO_LENGTH_OR_UINT32(array.length); |
1229 return InnerArrayFilter(f, receiver, array, length); | 1239 return InnerArrayFilter(f, receiver, array, length); |
1230 } | 1240 } |
1231 | 1241 |
| 1242 |
1232 function InnerArrayForEach(f, receiver, array, length) { | 1243 function InnerArrayForEach(f, receiver, array, length) { |
1233 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); | 1244 if (!IS_CALLABLE(f)) throw MakeTypeError(kCalledNonCallable, f); |
1234 | 1245 |
1235 var is_array = IS_ARRAY(array); | 1246 var is_array = IS_ARRAY(array); |
1236 var stepping = DEBUG_IS_STEPPING(f); | 1247 var stepping = DEBUG_IS_STEPPING(f); |
1237 for (var i = 0; i < length; i++) { | 1248 for (var i = 0; i < length; i++) { |
1238 if (HAS_INDEX(array, i, is_array)) { | 1249 if (HAS_INDEX(array, i, is_array)) { |
1239 var element = array[i]; | 1250 var element = array[i]; |
1240 // Prepare break slots for debugger step in. | 1251 // Prepare break slots for debugger step in. |
1241 if (stepping) %DebugPrepareStepInIfStepping(f); | 1252 if (stepping) %DebugPrepareStepInIfStepping(f); |
1242 %_Call(f, receiver, element, i, array); | 1253 %_Call(f, receiver, element, i, array); |
1243 } | 1254 } |
1244 } | 1255 } |
1245 } | 1256 } |
1246 | 1257 |
| 1258 |
1247 function ArrayForEach(f, receiver) { | 1259 function ArrayForEach(f, receiver) { |
1248 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.forEach"); | 1260 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.forEach"); |
1249 | 1261 |
1250 // Pull out the length so that modifications to the length in the | 1262 // Pull out the length so that modifications to the length in the |
1251 // loop will not affect the looping and side effects are visible. | 1263 // loop will not affect the looping and side effects are visible. |
1252 var array = TO_OBJECT(this); | 1264 var array = TO_OBJECT(this); |
1253 var length = TO_LENGTH_OR_UINT32(array.length); | 1265 var length = TO_LENGTH_OR_UINT32(array.length); |
1254 InnerArrayForEach(f, receiver, array, length); | 1266 InnerArrayForEach(f, receiver, array, length); |
1255 } | 1267 } |
1256 | 1268 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.reduceRight"); | 1557 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.reduceRight"); |
1546 | 1558 |
1547 // Pull out the length so that side effects are visible before the | 1559 // Pull out the length so that side effects are visible before the |
1548 // callback function is checked. | 1560 // callback function is checked. |
1549 var array = TO_OBJECT(this); | 1561 var array = TO_OBJECT(this); |
1550 var length = TO_LENGTH_OR_UINT32(array.length); | 1562 var length = TO_LENGTH_OR_UINT32(array.length); |
1551 return InnerArrayReduceRight(callback, current, array, length, | 1563 return InnerArrayReduceRight(callback, current, array, length, |
1552 %_ArgumentsLength()); | 1564 %_ArgumentsLength()); |
1553 } | 1565 } |
1554 | 1566 |
| 1567 |
| 1568 function InnerArrayCopyWithin(target, start, end, array, length) { |
| 1569 target = TO_INTEGER(target); |
| 1570 var to; |
| 1571 if (target < 0) { |
| 1572 to = MaxSimple(length + target, 0); |
| 1573 } else { |
| 1574 to = MinSimple(target, length); |
| 1575 } |
| 1576 |
| 1577 start = TO_INTEGER(start); |
| 1578 var from; |
| 1579 if (start < 0) { |
| 1580 from = MaxSimple(length + start, 0); |
| 1581 } else { |
| 1582 from = MinSimple(start, length); |
| 1583 } |
| 1584 |
| 1585 end = IS_UNDEFINED(end) ? length : TO_INTEGER(end); |
| 1586 var final; |
| 1587 if (end < 0) { |
| 1588 final = MaxSimple(length + end, 0); |
| 1589 } else { |
| 1590 final = MinSimple(end, length); |
| 1591 } |
| 1592 |
| 1593 var count = MinSimple(final - from, length - to); |
| 1594 var direction = 1; |
| 1595 if (from < to && to < (from + count)) { |
| 1596 direction = -1; |
| 1597 from = from + count - 1; |
| 1598 to = to + count - 1; |
| 1599 } |
| 1600 |
| 1601 while (count > 0) { |
| 1602 if (from in array) { |
| 1603 array[to] = array[from]; |
| 1604 } else { |
| 1605 delete array[to]; |
| 1606 } |
| 1607 from = from + direction; |
| 1608 to = to + direction; |
| 1609 count--; |
| 1610 } |
| 1611 |
| 1612 return array; |
| 1613 } |
| 1614 |
| 1615 |
| 1616 // ES6 draft 03-17-15, section 22.1.3.3 |
| 1617 function ArrayCopyWithin(target, start, end) { |
| 1618 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.copyWithin"); |
| 1619 |
| 1620 var array = TO_OBJECT(this); |
| 1621 var length = TO_LENGTH(array.length); |
| 1622 |
| 1623 return InnerArrayCopyWithin(target, start, end, array, length); |
| 1624 } |
| 1625 |
| 1626 |
| 1627 function InnerArrayFind(predicate, thisArg, array, length) { |
| 1628 if (!IS_CALLABLE(predicate)) { |
| 1629 throw MakeTypeError(kCalledNonCallable, predicate); |
| 1630 } |
| 1631 |
| 1632 for (var i = 0; i < length; i++) { |
| 1633 var element = array[i]; |
| 1634 if (%_Call(predicate, thisArg, element, i, array)) { |
| 1635 return element; |
| 1636 } |
| 1637 } |
| 1638 |
| 1639 return; |
| 1640 } |
| 1641 |
| 1642 |
| 1643 // ES6 draft 07-15-13, section 15.4.3.23 |
| 1644 function ArrayFind(predicate, thisArg) { |
| 1645 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.find"); |
| 1646 |
| 1647 var array = TO_OBJECT(this); |
| 1648 var length = TO_INTEGER(array.length); |
| 1649 |
| 1650 return InnerArrayFind(predicate, thisArg, array, length); |
| 1651 } |
| 1652 |
| 1653 |
| 1654 function InnerArrayFindIndex(predicate, thisArg, array, length) { |
| 1655 if (!IS_CALLABLE(predicate)) { |
| 1656 throw MakeTypeError(kCalledNonCallable, predicate); |
| 1657 } |
| 1658 |
| 1659 for (var i = 0; i < length; i++) { |
| 1660 var element = array[i]; |
| 1661 if (%_Call(predicate, thisArg, element, i, array)) { |
| 1662 return i; |
| 1663 } |
| 1664 } |
| 1665 |
| 1666 return -1; |
| 1667 } |
| 1668 |
| 1669 |
| 1670 // ES6 draft 07-15-13, section 15.4.3.24 |
| 1671 function ArrayFindIndex(predicate, thisArg) { |
| 1672 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.findIndex"); |
| 1673 |
| 1674 var array = TO_OBJECT(this); |
| 1675 var length = TO_INTEGER(array.length); |
| 1676 |
| 1677 return InnerArrayFindIndex(predicate, thisArg, array, length); |
| 1678 } |
| 1679 |
| 1680 |
| 1681 // ES6, draft 04-05-14, section 22.1.3.6 |
| 1682 function InnerArrayFill(value, start, end, array, length) { |
| 1683 var i = IS_UNDEFINED(start) ? 0 : TO_INTEGER(start); |
| 1684 var end = IS_UNDEFINED(end) ? length : TO_INTEGER(end); |
| 1685 |
| 1686 if (i < 0) { |
| 1687 i += length; |
| 1688 if (i < 0) i = 0; |
| 1689 } else { |
| 1690 if (i > length) i = length; |
| 1691 } |
| 1692 |
| 1693 if (end < 0) { |
| 1694 end += length; |
| 1695 if (end < 0) end = 0; |
| 1696 } else { |
| 1697 if (end > length) end = length; |
| 1698 } |
| 1699 |
| 1700 if ((end - i) > 0 && ObjectIsFrozen(array)) { |
| 1701 throw MakeTypeError(kArrayFunctionsOnFrozen); |
| 1702 } |
| 1703 |
| 1704 for (; i < end; i++) |
| 1705 array[i] = value; |
| 1706 return array; |
| 1707 } |
| 1708 |
| 1709 |
| 1710 // ES6, draft 04-05-14, section 22.1.3.6 |
| 1711 function ArrayFill(value, start, end) { |
| 1712 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill"); |
| 1713 |
| 1714 var array = TO_OBJECT(this); |
| 1715 var length = TO_LENGTH_OR_UINT32(array.length); |
| 1716 |
| 1717 return InnerArrayFill(value, start, end, array, length); |
| 1718 } |
| 1719 |
| 1720 |
1555 // ES5, 15.4.3.2 | 1721 // ES5, 15.4.3.2 |
1556 function ArrayIsArray(obj) { | 1722 function ArrayIsArray(obj) { |
1557 return IS_ARRAY(obj); | 1723 return IS_ARRAY(obj); |
1558 } | 1724 } |
1559 | 1725 |
1560 | 1726 |
| 1727 function AddArrayElement(constructor, array, i, value) { |
| 1728 if (constructor === GlobalArray) { |
| 1729 AddIndexedProperty(array, i, value); |
| 1730 } else { |
| 1731 ObjectDefineProperty(array, i, { |
| 1732 value: value, writable: true, configurable: true, enumerable: true |
| 1733 }); |
| 1734 } |
| 1735 } |
| 1736 |
| 1737 |
| 1738 // ES6, draft 10-14-14, section 22.1.2.1 |
| 1739 function ArrayFrom(arrayLike, mapfn, receiver) { |
| 1740 var items = TO_OBJECT(arrayLike); |
| 1741 var mapping = !IS_UNDEFINED(mapfn); |
| 1742 |
| 1743 if (mapping) { |
| 1744 if (!IS_CALLABLE(mapfn)) { |
| 1745 throw MakeTypeError(kCalledNonCallable, mapfn); |
| 1746 } |
| 1747 } |
| 1748 |
| 1749 var iterable = GetMethod(items, iteratorSymbol); |
| 1750 var k; |
| 1751 var result; |
| 1752 var mappedValue; |
| 1753 var nextValue; |
| 1754 |
| 1755 if (!IS_UNDEFINED(iterable)) { |
| 1756 result = %IsConstructor(this) ? new this() : []; |
| 1757 |
| 1758 var iterator = GetIterator(items, iterable); |
| 1759 |
| 1760 k = 0; |
| 1761 while (true) { |
| 1762 var next = iterator.next(); |
| 1763 |
| 1764 if (!IS_OBJECT(next)) { |
| 1765 throw MakeTypeError(kIteratorResultNotAnObject, next); |
| 1766 } |
| 1767 |
| 1768 if (next.done) { |
| 1769 result.length = k; |
| 1770 return result; |
| 1771 } |
| 1772 |
| 1773 nextValue = next.value; |
| 1774 if (mapping) { |
| 1775 mappedValue = %_Call(mapfn, receiver, nextValue, k); |
| 1776 } else { |
| 1777 mappedValue = nextValue; |
| 1778 } |
| 1779 AddArrayElement(this, result, k, mappedValue); |
| 1780 k++; |
| 1781 } |
| 1782 } else { |
| 1783 var len = TO_LENGTH(items.length); |
| 1784 result = %IsConstructor(this) ? new this(len) : new GlobalArray(len); |
| 1785 |
| 1786 for (k = 0; k < len; ++k) { |
| 1787 nextValue = items[k]; |
| 1788 if (mapping) { |
| 1789 mappedValue = %_Call(mapfn, receiver, nextValue, k); |
| 1790 } else { |
| 1791 mappedValue = nextValue; |
| 1792 } |
| 1793 AddArrayElement(this, result, k, mappedValue); |
| 1794 } |
| 1795 |
| 1796 result.length = k; |
| 1797 return result; |
| 1798 } |
| 1799 } |
| 1800 |
| 1801 |
| 1802 // ES6, draft 05-22-14, section 22.1.2.3 |
| 1803 function ArrayOf() { |
| 1804 var length = %_ArgumentsLength(); |
| 1805 var constructor = this; |
| 1806 // TODO: Implement IsConstructor (ES6 section 7.2.5) |
| 1807 var array = %IsConstructor(constructor) ? new constructor(length) : []; |
| 1808 for (var i = 0; i < length; i++) { |
| 1809 AddArrayElement(constructor, array, i, %_Arguments(i)); |
| 1810 } |
| 1811 array.length = length; |
| 1812 return array; |
| 1813 } |
| 1814 |
1561 // ------------------------------------------------------------------- | 1815 // ------------------------------------------------------------------- |
1562 | 1816 |
1563 // Set up non-enumerable constructor property on the Array.prototype | 1817 // Set up non-enumerable constructor property on the Array.prototype |
1564 // object. | 1818 // object. |
1565 %AddNamedProperty(GlobalArray.prototype, "constructor", GlobalArray, | 1819 %AddNamedProperty(GlobalArray.prototype, "constructor", GlobalArray, |
1566 DONT_ENUM); | 1820 DONT_ENUM); |
1567 | 1821 |
1568 // Set up unscopable properties on the Array.prototype object. | 1822 // Set up unscopable properties on the Array.prototype object. |
1569 var unscopables = { | 1823 var unscopables = { |
1570 __proto__: null, | 1824 __proto__: null, |
1571 copyWithin: true, | 1825 copyWithin: true, |
1572 entries: true, | 1826 entries: true, |
1573 fill: true, | 1827 fill: true, |
1574 find: true, | 1828 find: true, |
1575 findIndex: true, | 1829 findIndex: true, |
1576 keys: true, | 1830 keys: true, |
1577 }; | 1831 }; |
1578 | 1832 |
1579 %AddNamedProperty(GlobalArray.prototype, unscopablesSymbol, unscopables, | 1833 %AddNamedProperty(GlobalArray.prototype, unscopablesSymbol, unscopables, |
1580 DONT_ENUM | READ_ONLY); | 1834 DONT_ENUM | READ_ONLY); |
1581 | 1835 |
| 1836 %FunctionSetLength(ArrayFrom, 1); |
| 1837 |
1582 // Set up non-enumerable functions on the Array object. | 1838 // Set up non-enumerable functions on the Array object. |
1583 utils.InstallFunctions(GlobalArray, DONT_ENUM, [ | 1839 utils.InstallFunctions(GlobalArray, DONT_ENUM, [ |
1584 "isArray", ArrayIsArray | 1840 "isArray", ArrayIsArray, |
| 1841 "from", ArrayFrom, |
| 1842 "of", ArrayOf |
1585 ]); | 1843 ]); |
1586 | 1844 |
1587 var specialFunctions = %SpecialArrayFunctions(); | 1845 var specialFunctions = %SpecialArrayFunctions(); |
1588 | 1846 |
1589 var getFunction = function(name, jsBuiltin, len) { | 1847 var getFunction = function(name, jsBuiltin, len) { |
1590 var f = jsBuiltin; | 1848 var f = jsBuiltin; |
1591 if (specialFunctions.hasOwnProperty(name)) { | 1849 if (specialFunctions.hasOwnProperty(name)) { |
1592 f = specialFunctions[name]; | 1850 f = specialFunctions[name]; |
1593 } | 1851 } |
1594 if (!IS_UNDEFINED(len)) { | 1852 if (!IS_UNDEFINED(len)) { |
(...skipping 19 matching lines...) Expand all Loading... |
1614 "splice", getFunction("splice", ArraySplice, 2), | 1872 "splice", getFunction("splice", ArraySplice, 2), |
1615 "sort", getFunction("sort", ArraySort), | 1873 "sort", getFunction("sort", ArraySort), |
1616 "filter", getFunction("filter", ArrayFilter, 1), | 1874 "filter", getFunction("filter", ArrayFilter, 1), |
1617 "forEach", getFunction("forEach", ArrayForEach, 1), | 1875 "forEach", getFunction("forEach", ArrayForEach, 1), |
1618 "some", getFunction("some", ArraySome, 1), | 1876 "some", getFunction("some", ArraySome, 1), |
1619 "every", getFunction("every", ArrayEvery, 1), | 1877 "every", getFunction("every", ArrayEvery, 1), |
1620 "map", getFunction("map", ArrayMap, 1), | 1878 "map", getFunction("map", ArrayMap, 1), |
1621 "indexOf", getFunction("indexOf", ArrayIndexOf, 1), | 1879 "indexOf", getFunction("indexOf", ArrayIndexOf, 1), |
1622 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1), | 1880 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1), |
1623 "reduce", getFunction("reduce", ArrayReduce, 1), | 1881 "reduce", getFunction("reduce", ArrayReduce, 1), |
1624 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1) | 1882 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1), |
| 1883 "copyWithin", getFunction("copyWithin", ArrayCopyWithin, 2), |
| 1884 "find", getFunction("find", ArrayFind, 1), |
| 1885 "findIndex", getFunction("findIndex", ArrayFindIndex, 1), |
| 1886 "fill", getFunction("fill", ArrayFill, 1) |
1625 ]); | 1887 ]); |
1626 | 1888 |
1627 %FinishArrayPrototypeSetup(GlobalArray.prototype); | 1889 %FinishArrayPrototypeSetup(GlobalArray.prototype); |
1628 | 1890 |
1629 // The internal Array prototype doesn't need to be fancy, since it's never | 1891 // The internal Array prototype doesn't need to be fancy, since it's never |
1630 // exposed to user code. | 1892 // exposed to user code. |
1631 // Adding only the functions that are actually used. | 1893 // Adding only the functions that are actually used. |
1632 utils.SetUpLockedPrototype(InternalArray, GlobalArray(), [ | 1894 utils.SetUpLockedPrototype(InternalArray, GlobalArray(), [ |
1633 "indexOf", getFunction("indexOf", ArrayIndexOf), | 1895 "indexOf", getFunction("indexOf", ArrayIndexOf), |
1634 "join", getFunction("join", ArrayJoin), | 1896 "join", getFunction("join", ArrayJoin), |
(...skipping 19 matching lines...) Expand all Loading... |
1654 "shift", getFunction("shift", ArrayShift), | 1916 "shift", getFunction("shift", ArrayShift), |
1655 "unshift", getFunction("unshift", ArrayUnshift), | 1917 "unshift", getFunction("unshift", ArrayUnshift), |
1656 "splice", getFunction("splice", ArraySplice), | 1918 "splice", getFunction("splice", ArraySplice), |
1657 "slice", getFunction("slice", ArraySlice) | 1919 "slice", getFunction("slice", ArraySlice) |
1658 ]); | 1920 ]); |
1659 | 1921 |
1660 // ------------------------------------------------------------------- | 1922 // ------------------------------------------------------------------- |
1661 // Exports | 1923 // Exports |
1662 | 1924 |
1663 utils.Export(function(to) { | 1925 utils.Export(function(to) { |
| 1926 to.ArrayFrom = ArrayFrom; |
1664 to.ArrayIndexOf = ArrayIndexOf; | 1927 to.ArrayIndexOf = ArrayIndexOf; |
1665 to.ArrayJoin = ArrayJoin; | 1928 to.ArrayJoin = ArrayJoin; |
1666 to.ArrayPush = ArrayPush; | 1929 to.ArrayPush = ArrayPush; |
1667 to.ArrayToString = ArrayToString; | 1930 to.ArrayToString = ArrayToString; |
| 1931 to.InnerArrayCopyWithin = InnerArrayCopyWithin; |
1668 to.InnerArrayEvery = InnerArrayEvery; | 1932 to.InnerArrayEvery = InnerArrayEvery; |
| 1933 to.InnerArrayFill = InnerArrayFill; |
1669 to.InnerArrayFilter = InnerArrayFilter; | 1934 to.InnerArrayFilter = InnerArrayFilter; |
| 1935 to.InnerArrayFind = InnerArrayFind; |
| 1936 to.InnerArrayFindIndex = InnerArrayFindIndex; |
1670 to.InnerArrayForEach = InnerArrayForEach; | 1937 to.InnerArrayForEach = InnerArrayForEach; |
1671 to.InnerArrayIndexOf = InnerArrayIndexOf; | 1938 to.InnerArrayIndexOf = InnerArrayIndexOf; |
1672 to.InnerArrayJoin = InnerArrayJoin; | 1939 to.InnerArrayJoin = InnerArrayJoin; |
1673 to.InnerArrayLastIndexOf = InnerArrayLastIndexOf; | 1940 to.InnerArrayLastIndexOf = InnerArrayLastIndexOf; |
1674 to.InnerArrayMap = InnerArrayMap; | 1941 to.InnerArrayMap = InnerArrayMap; |
1675 to.InnerArrayReduce = InnerArrayReduce; | 1942 to.InnerArrayReduce = InnerArrayReduce; |
1676 to.InnerArrayReduceRight = InnerArrayReduceRight; | 1943 to.InnerArrayReduceRight = InnerArrayReduceRight; |
1677 to.InnerArraySome = InnerArraySome; | 1944 to.InnerArraySome = InnerArraySome; |
1678 to.InnerArraySort = InnerArraySort; | 1945 to.InnerArraySort = InnerArraySort; |
1679 to.InnerArrayToLocaleString = InnerArrayToLocaleString; | 1946 to.InnerArrayToLocaleString = InnerArrayToLocaleString; |
1680 to.PackedArrayReverse = PackedArrayReverse; | 1947 to.PackedArrayReverse = PackedArrayReverse; |
1681 }); | 1948 }); |
1682 | 1949 |
1683 %InstallToContext([ | 1950 %InstallToContext([ |
1684 "array_pop", ArrayPop, | 1951 "array_pop", ArrayPop, |
1685 "array_push", ArrayPush, | 1952 "array_push", ArrayPush, |
1686 "array_shift", ArrayShift, | 1953 "array_shift", ArrayShift, |
1687 "array_splice", ArraySplice, | 1954 "array_splice", ArraySplice, |
1688 "array_slice", ArraySlice, | 1955 "array_slice", ArraySlice, |
1689 "array_unshift", ArrayUnshift, | 1956 "array_unshift", ArrayUnshift, |
1690 ]); | 1957 ]); |
1691 | 1958 |
1692 }); | 1959 }); |
OLD | NEW |