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

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: Use insertBefore and add is-check. 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
« no previous file with comments | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/byte_array.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array.dart
diff --git a/runtime/lib/array.dart b/runtime/lib/array.dart
index eb7bc70760ff48b847726524943831e8409efbb8..dca6c1505fae6f502a746830dbdc407d7359b403 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 insert(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");
@@ -265,6 +270,11 @@ class _ImmutableArray<E> implements List<E> {
int get length native "ObjectArray_getLength";
+ void insert(int index, E element) {
+ throw new UnsupportedError(
+ "Cannot add to an immutable array");
+ }
+
E removeAt(int index) {
throw new UnsupportedError(
"Cannot modify an immutable array");
« no previous file with comments | « pkg/serialization/lib/src/serialization_rule.dart ('k') | runtime/lib/byte_array.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698