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

Unified Diff: runtime/lib/growable_array.dart

Issue 1318943005: Update range errors to agree on the numbers. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: More tests Created 5 years, 3 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
Index: runtime/lib/growable_array.dart
diff --git a/runtime/lib/growable_array.dart b/runtime/lib/growable_array.dart
index bd79837fec4b124ea5b59a6a3badf31a74de323d..39b4522c72711d9e3cb1cffd56f875dd5eec54f8 100644
--- a/runtime/lib/growable_array.dart
+++ b/runtime/lib/growable_array.dart
@@ -70,14 +70,13 @@ class _GrowableList<T> extends ListBase<T> {
}
void removeRange(int start, int end) {
- Lists.indicesCheck(this, start, end);
+ RangeError.checkValidRange(start, end, this.length);
Lists.copy(this, end, this, start, this.length - end);
this.length = this.length - (end - start);
}
List<T> sublist(int start, [int end]) {
- Lists.indicesCheck(this, start, end);
- if (end == null) end = this.length;
+ end = RangeError.checkValidRange(start, end, this.length);
int length = end - start;
if (length == 0) return <T>[];
List list = new _List(length);

Powered by Google App Engine
This is Rietveld 408576698