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

Unified Diff: sdk/lib/_collection_dev/arrays.dart

Issue 12817003: Change getRange to sublist. Make getRange deprecated. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments Created 7 years, 9 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: sdk/lib/_collection_dev/arrays.dart
diff --git a/sdk/lib/_collection_dev/arrays.dart b/sdk/lib/_collection_dev/arrays.dart
index d38240effef850d1dd29ddfa341ad11cf70dafaf..662fa4999e3e9efc589d311c2f92d344bd4197fb 100644
--- a/sdk/lib/_collection_dev/arrays.dart
+++ b/sdk/lib/_collection_dev/arrays.dart
@@ -75,6 +75,15 @@ class Arrays {
return -1;
}
+ static void indicesCheck(List a, int start, int end) {
+ if (start < 0 || start > a.length) {
+ throw new RangeError.range(start, 0, a.length);
+ }
+ if (end != null && (end < start || end > a.length)) {
+ throw new RangeError.range(end, start, a.length);
+ }
+ }
+
static void rangeCheck(List a, int start, int length) {
if (length < 0) {
throw new ArgumentError("negative length $length");

Powered by Google App Engine
This is Rietveld 408576698