OLD | NEW |
1 // Copyright 2006-2008 Google Inc. All Rights Reserved. | 1 // Copyright 2006-2008 Google Inc. All Rights Reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 // This file relies on the fact that the following declarations have been made | 28 // This file relies on the fact that the following declarations have been made |
29 // in runtime.js: | 29 // in runtime.js: |
30 // const $Array = global.Array; | 30 // const $Array = global.Array; |
31 | 31 |
32 // ------------------------------------------------------------------- | 32 // ------------------------------------------------------------------- |
33 | 33 |
34 // Determines if the array contains the element. | |
35 function Contains(array, element) { | |
36 var length = array.length; | |
37 for (var i = 0; i < length; i++) { | |
38 if (array[i] === element) return true; | |
39 } | |
40 return false; | |
41 }; | |
42 | |
43 | 34 |
44 // Global list of arrays visited during toString, toLocaleString and | 35 // Global list of arrays visited during toString, toLocaleString and |
45 // join invocations. | 36 // join invocations. |
46 var visited_arrays = new $Array(); | 37 var visited_arrays = new $Array(); |
47 | 38 |
48 | 39 |
49 // Gets a sorted array of array keys. Useful for operations on sparse | 40 // Gets a sorted array of array keys. Useful for operations on sparse |
50 // arrays. Dupes have not been removed. | 41 // arrays. Dupes have not been removed. |
51 function GetSortedArrayKeys(array, intervals) { | 42 function GetSortedArrayKeys(array, intervals) { |
52 var length = intervals.length; | 43 var length = intervals.length; |
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 ArrayEvery: 1, | 911 ArrayEvery: 1, |
921 ArrayMap: 1, | 912 ArrayMap: 1, |
922 ArrayIndexOf: 1, | 913 ArrayIndexOf: 1, |
923 ArrayLastIndexOf: 1, | 914 ArrayLastIndexOf: 1, |
924 ArrayPush: 1 | 915 ArrayPush: 1 |
925 }); | 916 }); |
926 }; | 917 }; |
927 | 918 |
928 | 919 |
929 SetupArray(); | 920 SetupArray(); |
OLD | NEW |