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

Unified Diff: sdk/lib/core/list.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 | « sdk/lib/_internal/compiler/implementation/lib/js_array.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index ca02365f644c5aec320be5a900dad1525c3ed9eb..3dfccb0e0e4c6ccf81a2ab03a2c816cb9ee047f9 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -193,7 +193,18 @@ abstract class List<E> implements Collection<E> {
void clear();
/**
- * Removes the element at position[index] from the list.
+ * Inserts the element at position [index] in the list.
+ *
+ * This increases the length of the list by one and shifts all later elements
+ * towards the end of the list.
+ *
+ * It is an error if the [index] does not point inside the list or at the
+ * position after the last element.
+ */
+ void insert(int index, E element);
+
+ /**
+ * Removes the element at position [index] from the list.
*
* This reduces the length of the list by one and moves all later elements
* down by one position.
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/js_array.dart ('k') | sdk/lib/html/dart2js/html_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698