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

Unified Diff: sdk/lib/collection/queue.dart

Issue 711003002: Add some ArgumentError and RangeError constructors that capture more information. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/collection/queue.dart
diff --git a/sdk/lib/collection/queue.dart b/sdk/lib/collection/queue.dart
index 9e8580d6d18751a8b48ea7c9a2d83abeee6e8fe3..fc568ff1cb9a8df8813645a2ba380b0bd7f646e1 100644
--- a/sdk/lib/collection/queue.dart
+++ b/sdk/lib/collection/queue.dart
@@ -427,8 +427,8 @@ class ListQueue<E> extends IterableBase<E> implements Queue<E> {
}
E elementAt(int index) {
- if (index < 0 || index > length) {
- throw new RangeError.range(index, 0, length);
+ if (index < 0 || index >= length) {
+ throw new RangeError.index(index, this);
}
return _table[(_head + index) & (_table.length - 1)];
}

Powered by Google App Engine
This is Rietveld 408576698