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 class _GrowableList<T> implements List<T> { | 5 class _GrowableList<T> implements List<T> { |
6 static final int _classId = (new _GrowableList(0))._cid; | 6 static final int _classId = ClassID.getID(new _GrowableList(0)); |
7 | 7 |
8 void insert(int index, T element) { | 8 void insert(int index, T element) { |
9 if (index < 0 || index > length) { | 9 if (index < 0 || index > length) { |
10 throw new RangeError.range(index, 0, length); | 10 throw new RangeError.range(index, 0, length); |
11 } | 11 } |
12 if (index == this.length) { | 12 if (index == this.length) { |
13 add(element); | 13 add(element); |
14 return; | 14 return; |
15 } | 15 } |
16 int oldLength = this.length; | 16 int oldLength = this.length; |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 } | 340 } |
341 | 341 |
342 Set<T> toSet() { | 342 Set<T> toSet() { |
343 return new Set<T>.from(this); | 343 return new Set<T>.from(this); |
344 } | 344 } |
345 | 345 |
346 Map<int, T> asMap() { | 346 Map<int, T> asMap() { |
347 return IterableMixinWorkaround.asMapList(this); | 347 return IterableMixinWorkaround.asMapList(this); |
348 } | 348 } |
349 } | 349 } |
OLD | NEW |