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

Unified Diff: runtime/lib/array.dart

Issue 10970009: Add list.removeAt method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index b0dcf3a6efe844432ef491910f53a682f3d3d9bc..1fba6dbd19a7403e0c741c511512e3dac5bb887d 100644
--- a/runtime/lib/array.dart
+++ b/runtime/lib/array.dart
@@ -24,6 +24,11 @@ class ObjectArray<E> implements List<E> {
int count)
native "ObjectArray_copyFromObjectArray";
+ E removeAt(int index) {
+ throw const UnsupportedOperationException(
+ "Cannot remove element of a non-extendable array");
+ }
+
void setRange(int start, int length, List<E> from, [int startFrom = 0]) {
if (length < 0) {
throw new IllegalArgumentException("negative length $length");
@@ -161,6 +166,11 @@ class ImmutableArray<E> implements List<E> {
int get length native "ObjectArray_getLength";
+ E removeAt(int index) {
+ throw const UnsupportedOperationException(
+ "Cannot modify an immitable array");
Johnni Winther 2012/09/20 09:22:50 immitable => immutable
Lasse Reichstein Nielsen 2012/09/20 10:50:29 Done.
+ }
+
void copyFrom(List src, int srcStart, int dstStart, int count) {
throw const UnsupportedOperationException(
"Cannot modify an immutable array");
« lib/core/list.dart ('K') | « lib/core/list.dart ('k') | runtime/lib/growable_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698