Lines Matching refs:lastIndexOf
117 // Array.prototype.lastIndexOf.
121 assertEquals(-1, [].lastIndexOf(1));
122 assertEquals(-1, array.lastIndexOf(1, -17));
124 assertEquals(9, array.lastIndexOf(1));
126 assertEquals(9, array.lastIndexOf(1, array.length));
128 assertEquals(0, array.lastIndexOf(1, 2));
129 assertEquals(3, array.lastIndexOf(1, 4));
130 assertEquals(3, array.lastIndexOf(1, 3));
132 assertEquals(0, array.lastIndexOf(1, -11));
135 assertEquals(7, undef_array.lastIndexOf(undefined));
136 assertEquals(-1, undef_array.lastIndexOf(undefined, 2));
137 assertEquals(3, undef_array.lastIndexOf(undefined, 3));
138 assertEquals(3, undef_array.lastIndexOf(undefined, 6));
139 assertEquals(7, undef_array.lastIndexOf(undefined, 7));
140 assertEquals(7, undef_array.lastIndexOf(undefined, -1));
141 assertEquals(-1, undef_array.lastIndexOf(undefined, -9));
142 assertEquals(3, undef_array.lastIndexOf(undefined, -8));
143 assertEquals(3, undef_array.lastIndexOf(undefined, -5));
144 assertEquals(7, undef_array.lastIndexOf(undefined, -4));
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));
168 assertEquals(0, Array.prototype.lastIndexOf.call(dense_object, 42));
169 assertEquals(1, Array.prototype.lastIndexOf.call(dense_object, 37));
170 assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42));
171 assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37));
174 assertEquals(0, Array.prototype.lastIndexOf.call(dense_object, 42));
175 assertEquals(1, Array.prototype.lastIndexOf.call(dense_object, 37));
176 assertEquals(-1, Array.prototype.lastIndexOf.call(dense_object, 87));
178 assertEquals(0, Array.prototype.lastIndexOf.call(sparse_object, 42));
179 assertEquals(100000, Array.prototype.lastIndexOf.call(sparse_object, 37));
180 assertEquals(-1, Array.prototype.lastIndexOf.call(sparse_object, 87));
182 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42, 15));
183 assertEquals(10, Array.prototype.lastIndexOf.call(funky_object, 42));
184 assertEquals(-1, Array.prototype.lastIndexOf.call(funky_object, 37));
186 assertEquals(-1, Array.prototype.lastIndexOf.call(infinite_object, 42));