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

Unified Diff: runtime/lib/array.dart

Issue 12383073: Add List.insert. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 688cfb5e02380e9ee38e4b5c0a10da678da99c7c..d73ec4c471af854ab5f39c5c8628b3825c691215 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";
+ void insertAt(int index, E element) {
+ throw new UnsupportedError(
+ "Cannot add to a non-extendable array");
+ }
+
E removeAt(int index) {
throw new UnsupportedError(
"Cannot remove element of a non-extendable array");
@@ -261,6 +266,11 @@ class _ImmutableArray<E> implements List<E> {
int get length native "ObjectArray_getLength";
+ void insertAt(int index, E element) {
+ throw new UnsupportedError(
+ "Cannot add to a non-extendable array");
srdjan 2013/03/04 00:53:47 to an immutable array
Lasse Reichstein Nielsen 2013/03/04 09:06:02 Consider changing "immutable" to "unmodifiable" wh
floitsch 2013/03/05 17:51:58 Done.
floitsch 2013/03/05 17:51:58 not in this CL. Filed http://dartbug.com/8925
+ }
+
E removeAt(int index) {
throw new UnsupportedError(
"Cannot modify an immutable array");

Powered by Google App Engine
This is Rietveld 408576698