| 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 | 5 |
| 6 // TODO(srdjan): Use shared array implementation. | 6 // TODO(srdjan): Use shared array implementation. |
| 7 class _ObjectArray<E> implements List<E> { | 7 class _ObjectArray<E> implements List<E> { |
| 8 | 8 |
| 9 factory _ObjectArray(length) native "ObjectArray_allocate"; | 9 factory _ObjectArray(length) native "ObjectArray_allocate"; |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 Iterable<E> getRange(int start, [int end]) { | 61 Iterable<E> getRange(int start, [int end]) { |
| 62 return IterableMixinWorkaround.getRangeList(this, start, end); | 62 return IterableMixinWorkaround.getRangeList(this, start, end); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // List interface. | 65 // List interface. |
| 66 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { | 66 void setRange(int start, int end, Iterable<E> iterable, [int skipCount = 0]) { |
| 67 if (start < 0 || start > this.length) { | 67 if (start < 0 || start > this.length) { |
| 68 throw new RangeError.range(start, 0, this.length); | 68 throw new RangeError.range(start, 0, this.length); |
| 69 } | 69 } |
| 70 if (end < 0 || end > this.length) { | 70 if (end < start || end > this.length) { |
| 71 throw new RangeError.range(end, start, this.length); | 71 throw new RangeError.range(end, start, this.length); |
| 72 } | 72 } |
| 73 int length = end - start; | 73 int length = end - start; |
| 74 if (length == 0) return; | 74 if (length == 0) return; |
| 75 | 75 |
| 76 if (iterable is _ObjectArray) { | 76 if (iterable is _ObjectArray) { |
| 77 _copyFromObjectArray(iterable, skipCount, start, length); | 77 _copyFromObjectArray(iterable, skipCount, start, length); |
| 78 } else { | 78 } else { |
| 79 List otherList; | 79 List otherList; |
| 80 int otherStart; | 80 int otherStart; |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 } | 543 } |
| 544 _position = _length; | 544 _position = _length; |
| 545 _current = null; | 545 _current = null; |
| 546 return false; | 546 return false; |
| 547 } | 547 } |
| 548 | 548 |
| 549 E get current { | 549 E get current { |
| 550 return _current; | 550 return _current; |
| 551 } | 551 } |
| 552 } | 552 } |
| OLD | NEW |