| 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 _GrowableObjectArray<T> implements List<T> { | 5 class _GrowableObjectArray<T> implements List<T> { |
| 6 factory _GrowableObjectArray._uninstantiable() { | 6 static final int _classId = (new _GrowableObjectArray(0))._cid; |
| 7 throw new UnsupportedError( | |
| 8 "GrowableObjectArray can only be allocated by the VM"); | |
| 9 } | |
| 10 | 7 |
| 11 void insert(int index, T element) { | 8 void insert(int index, T element) { |
| 12 if (index < 0 || index > length) { | 9 if (index < 0 || index > length) { |
| 13 throw new RangeError.range(index, 0, length); | 10 throw new RangeError.range(index, 0, length); |
| 14 } | 11 } |
| 15 if (index == this.length) { | 12 if (index == this.length) { |
| 16 add(element); | 13 add(element); |
| 17 return; | 14 return; |
| 18 } | 15 } |
| 19 int oldLength = this.length; | 16 int oldLength = this.length; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 347 } |
| 351 | 348 |
| 352 Set<T> toSet() { | 349 Set<T> toSet() { |
| 353 return new Set<T>.from(this); | 350 return new Set<T>.from(this); |
| 354 } | 351 } |
| 355 | 352 |
| 356 Map<int, T> asMap() { | 353 Map<int, T> asMap() { |
| 357 return IterableMixinWorkaround.asMapList(this); | 354 return IterableMixinWorkaround.asMapList(this); |
| 358 } | 355 } |
| 359 } | 356 } |
| OLD | NEW |