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

Unified Diff: sdk/lib/core/list.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/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index f7d012b4891db8e0f48ddd2e5854e1471f0959c7..58d6139ae8dd4197d4b69612643b9b0158e9f523 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -225,13 +225,19 @@ abstract class List<E> implements Collection<E> {
E removeLast();
/**
- * Returns a new list containing [length] elements from the list,
- * starting at [start].
- * Returns an empty list if [length] is 0.
- * Throws an [ArgumentError] if [length] is negative.
- * Throws an [RangeError] if [start] or
- * [:start + length - 1:] are out of range.
+ * Returns a new list containing the elemenst from [start] to [end].
+ *
+ * If [end] is omitted, the [length] of the list is used.
+ *
+ * It is an error if [start] or [end] are not list indices for this list,
+ * or if [end] is before [start].
*/
+ List<E> sublist(int start, [int end]);
+
+ /**
+ * *Deprecated*. Use [sublist] instead.
+ */
+ @deprecated
List<E> getRange(int start, int length);
/**

Powered by Google App Engine
This is Rietveld 408576698