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

Unified Diff: runtime/lib/typed_data.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/typed_data.dart
diff --git a/runtime/lib/typed_data.dart b/runtime/lib/typed_data.dart
index f70781a8c2b9527de873ec00a30b91315afb5677..a56c39fd2da6c5a4dce6917a4be1c539ef83b01e 100644
--- a/runtime/lib/typed_data.dart
+++ b/runtime/lib/typed_data.dart
@@ -477,9 +477,8 @@ abstract class _TypedListBase {
}
List sublist(int start, [int end]) {
- if (end == null) end = this.length;
+ end = RangeError.checkValidRange(start, end, this.length);
var length = end - start;
- _rangeCheck(this.length, start, length);
List result = _createList(length);
result.setRange(0, length, this, start);
return result;

Powered by Google App Engine
This is Rietveld 408576698