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

Unified Diff: runtime/lib/growable_array.dart

Issue 10786045: Improve the error messages for IndexOutOfRangeException. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index b87e6b954f6fad4b15fc51820411eb2de43226e8..eb907689184bebace5c14fcb87bed3b74d041324 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -23,15 +23,7 @@ class GrowableObjectArray<T> implements List<T> {
if (length == 0) {
return;
}
- if (length < 0) {
- throw new IllegalArgumentException("negative length $length");
- }
- if (start < 0 || start >= this.length) {
- throw new IndexOutOfRangeException(start);
- }
- if (start + length > this.length) {
- throw new IndexOutOfRangeException(start + length);
- }
+ Arrays.rangeCheck(this, start, length);
Arrays.copy(this,
start + length,
this,
« no previous file with comments | « runtime/lib/byte_array.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698