| 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 dart._interceptors; | 5 part of dart._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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // TODO(22407): Improve bounds check elimination to allow this JS code to | 236 // TODO(22407): Improve bounds check elimination to allow this JS code to |
| 237 // be replaced by indexing. | 237 // be replaced by indexing. |
| 238 var/*=E*/ element = JS('', '#[#]', this, i); | 238 var/*=E*/ element = JS('', '#[#]', this, i); |
| 239 value = combine(value, element); | 239 value = combine(value, element); |
| 240 if (length != this.length) throw new ConcurrentModificationError(this); | 240 if (length != this.length) throw new ConcurrentModificationError(this); |
| 241 } | 241 } |
| 242 return value; | 242 return value; |
| 243 } | 243 } |
| 244 | 244 |
| 245 /*=T*/ fold/*<T>*/( | 245 /*=T*/ fold/*<T>*/( |
| 246 /*=T*/ initialValue, /*=T*/ combine(/*=T*/ previousValue, E element)) { | 246 /*=T*/ initialValue, |
| 247 /*=T*/ combine(/*=T*/ previousValue, E element)) { |
| 247 var/*=T*/ value = initialValue; | 248 var/*=T*/ value = initialValue; |
| 248 int length = this.length; | 249 int length = this.length; |
| 249 for (int i = 0; i < length; i++) { | 250 for (int i = 0; i < length; i++) { |
| 250 // TODO(22407): Improve bounds check elimination to allow this JS code to | 251 // TODO(22407): Improve bounds check elimination to allow this JS code to |
| 251 // be replaced by indexing. | 252 // be replaced by indexing. |
| 252 var/*=E*/ element = JS('', '#[#]', this, i); | 253 var/*=E*/ element = JS('', '#[#]', this, i); |
| 253 value = combine(value, element); | 254 value = combine(value, element); |
| 254 if (this.length != length) throw new ConcurrentModificationError(this); | 255 if (this.length != length) throw new ConcurrentModificationError(this); |
| 255 } | 256 } |
| 256 return value; | 257 return value; |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 | 621 |
| 621 if (_index >= length) { | 622 if (_index >= length) { |
| 622 _current = null; | 623 _current = null; |
| 623 return false; | 624 return false; |
| 624 } | 625 } |
| 625 _current = _iterable[_index]; | 626 _current = _iterable[_index]; |
| 626 _index++; | 627 _index++; |
| 627 return true; | 628 return true; |
| 628 } | 629 } |
| 629 } | 630 } |
| OLD | NEW |