OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of _interceptors; | 5 part of _interceptors; |
6 | 6 |
7 /** | 7 /** |
8 * The interceptor class for [List]. The compiler recognizes this | 8 * The interceptor class for [List]. The compiler recognizes this |
9 * class as an interceptor, and changes references to [:this:] to | 9 * class as an interceptor, and changes references to [:this:] to |
10 * actually use the receiver of the method, which is generated as an extra | 10 * actually use the receiver of the method, which is generated as an extra |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 throw new RangeError.value(start + length); | 214 throw new RangeError.value(start + length); |
215 } | 215 } |
216 | 216 |
217 Arrays.copy(from, startFrom, this, start, length); | 217 Arrays.copy(from, startFrom, this, start, length); |
218 } | 218 } |
219 | 219 |
220 bool any(bool f(E element)) => IterableMixinWorkaround.any(this, f); | 220 bool any(bool f(E element)) => IterableMixinWorkaround.any(this, f); |
221 | 221 |
222 bool every(bool f(E element)) => IterableMixinWorkaround.every(this, f); | 222 bool every(bool f(E element)) => IterableMixinWorkaround.every(this, f); |
223 | 223 |
| 224 List<E> get reversed => new ReversedListView<E>(this, 0, null); |
| 225 |
224 void sort([int compare(E a, E b)]) { | 226 void sort([int compare(E a, E b)]) { |
225 checkMutable(this, 'sort'); | 227 checkMutable(this, 'sort'); |
226 IterableMixinWorkaround.sortList(this, compare); | 228 IterableMixinWorkaround.sortList(this, compare); |
227 } | 229 } |
228 | 230 |
229 int indexOf(E element, [int start = 0]) { | 231 int indexOf(E element, [int start = 0]) { |
230 if (start is !int) throw new ArgumentError(start); | 232 if (start is !int) throw new ArgumentError(start); |
231 return Arrays.indexOf(this, element, start, length); | 233 return Arrays.indexOf(this, element, start, length); |
232 } | 234 } |
233 | 235 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if (nextPosition < length) { | 301 if (nextPosition < length) { |
300 _position = nextPosition; | 302 _position = nextPosition; |
301 _current = _list[nextPosition]; | 303 _current = _list[nextPosition]; |
302 return true; | 304 return true; |
303 } | 305 } |
304 _position = length; | 306 _position = length; |
305 _current = null; | 307 _current = null; |
306 return false; | 308 return false; |
307 } | 309 } |
308 } | 310 } |
OLD | NEW |