Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Side by Side Diff: runtime/lib/growable_array.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Regenerated html files. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/growable_array.cc ('k') | runtime/lib/regexp_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 factory _GrowableObjectArray._uninstantiable() {
7 throw new UnsupportedError( 7 throw new UnsupportedError(
8 "GrowableObjectArray can only be allocated by the VM"); 8 "GrowableObjectArray can only be allocated by the VM");
9 } 9 }
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 void insertRange(int start, int length, [T initialValue = null]) { 44 void insertRange(int start, int length, [T initialValue = null]) {
45 if (length == 0) { 45 if (length == 0) {
46 return; 46 return;
47 } 47 }
48 if ((length < 0) || (length is! int)) { 48 if ((length < 0) || (length is! int)) {
49 throw new ArgumentError("invalid length specified $length"); 49 throw new ArgumentError("invalid length specified $length");
50 } 50 }
51 if (start < 0 || start > this.length) { 51 if (start < 0 || start > this.length) {
52 throw new IndexOutOfRangeException(start); 52 throw new RangeError.value(start);
53 } 53 }
54 var old_length = this.length; 54 var old_length = this.length;
55 this.length = old_length + length; // Will expand if needed. 55 this.length = old_length + length; // Will expand if needed.
56 Arrays.copy(this, 56 Arrays.copy(this,
57 start, 57 start,
58 this, 58 this,
59 start + length, 59 start + length,
60 old_length - start); 60 old_length - start);
61 for (int i = start; i < start + length; i++) { 61 for (int i = start; i < start + length; i++) {
62 this[i] = initialValue; 62 this[i] = initialValue;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 String toString() { 214 String toString() {
215 return Collections.collectionToString(this); 215 return Collections.collectionToString(this);
216 } 216 }
217 217
218 Iterator<T> iterator() { 218 Iterator<T> iterator() {
219 return new SequenceIterator<T>(this); 219 return new SequenceIterator<T>(this);
220 } 220 }
221 } 221 }
OLDNEW
« no previous file with comments | « runtime/lib/growable_array.cc ('k') | runtime/lib/regexp_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698