Lines Matching refs:sparse_array

31 var sparse_array = [];  variable
32 sparse_array[100] = 3;
33 sparse_array[200] = undefined;
34 sparse_array[300] = 4;
35 sparse_array[400] = 5;
36 sparse_array[500] = 6;
37 sparse_array[600] = 5;
38 sparse_array[700] = 4;
39 sparse_array[800] = undefined;
40 sparse_array[900] = 3
41 sparse_array[41999] = "filler";
80 assertEquals(100, sparse_array.indexOf(3));
81 assertEquals(900, sparse_array.indexOf(3, 101));
82 assertEquals(-1, sparse_array.indexOf(3, 901));
83 assertEquals(100, sparse_array.indexOf(3, -42000));
84 assertEquals(900, sparse_array.indexOf(3, 101 - 42000));
85 assertEquals(-1, sparse_array.indexOf(3, 901 - 42000));
87 assertEquals(300, sparse_array.indexOf(4));
88 assertEquals(700, sparse_array.indexOf(4, 301));
89 assertEquals(-1, sparse_array.indexOf(4, 701));
90 assertEquals(300, sparse_array.indexOf(4, -42000));
91 assertEquals(700, sparse_array.indexOf(4, 301 - 42000));
92 assertEquals(-1, sparse_array.indexOf(4, 701 - 42000));
94 assertEquals(200, sparse_array.indexOf(undefined));
95 assertEquals(800, sparse_array.indexOf(undefined, 201));
96 assertEquals(-1, sparse_array.indexOf(undefined, 801));
97 assertEquals(200, sparse_array.indexOf(undefined, -42000));
98 assertEquals(800, sparse_array.indexOf(undefined, 201 - 42000));
99 assertEquals(-1, sparse_array.indexOf(undefined, 801 - 42000));
147 assertEquals(900, sparse_array.lastIndexOf(3));
148 assertEquals(100, sparse_array.lastIndexOf(3, 899));
149 assertEquals(-1, sparse_array.lastIndexOf(3, 99));
150 assertEquals(900, sparse_array.lastIndexOf(3, -1));
151 assertEquals(100, sparse_array.lastIndexOf(3, 899 - 42000));
152 assertEquals(-1, sparse_array.lastIndexOf(3, 99 - 42000));
154 assertEquals(700, sparse_array.lastIndexOf(4));
155 assertEquals(300, sparse_array.lastIndexOf(4, 699));
156 assertEquals(-1, sparse_array.lastIndexOf(4, 299));
157 assertEquals(700, sparse_array.lastIndexOf(4, -1));
158 assertEquals(300, sparse_array.lastIndexOf(4, 699 - 42000));
159 assertEquals(-1, sparse_array.lastIndexOf(4, 299 - 42000));
161 assertEquals(800, sparse_array.lastIndexOf(undefined));
162 assertEquals(200, sparse_array.lastIndexOf(undefined, 799));
163 assertEquals(-1, sparse_array.lastIndexOf(undefined, 199));
164 assertEquals(800, sparse_array.lastIndexOf(undefined, -1));
165 assertEquals(200, sparse_array.lastIndexOf(undefined, 799 - 42000));
166 assertEquals(-1, sparse_array.lastIndexOf(undefined, 199 - 42000));