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

Unified Diff: runtime/lib/array.dart

Issue 8273004: Implement removeRange, and update some documentation on the list interface. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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/array.dart
===================================================================
--- runtime/lib/array.dart (revision 394)
+++ runtime/lib/array.dart (working copy)
@@ -93,11 +93,13 @@
native "ObjectArray_copyFromObjectArray";
void setRange(int start, int length, List<T> from, [int startFrom = 0]) {
+ if (length < 0) throw new IllegalArgumentException(length);
copyFrom(from, start, startFrom, count);
}
void removeRange(int start, int length) {
- throw const NotImplementedException();
+ throw const UnsupportedOperationException(
+ "Cannot remove range of a non-extendable array");
}
void insertRange(int start, int length, [T initialValue = null]) {
@@ -212,7 +214,8 @@
}
void removeRange(int start, int length) {
- throw const NotImplementedException();
+ throw const UnsupportedOperationException(
+ "Cannot remove range of an immutable array");
}
void insertRange(int start, int length, [T initialValue = null]) {

Powered by Google App Engine
This is Rietveld 408576698