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

Unified Diff: sdk/lib/core/list.dart

Issue 1056353004: Add List.unmodifiable constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove left-over debug coide. Created 5 years, 8 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: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 05c4c2e2b6d5df185d2ec015a501a82d55537ade..9d9a0933207b184c79efbc72b8b491d183ad87f7 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -122,6 +122,17 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
}
/**
+ * Creates an unmodifiable list containing all [elements].
+ *
+ * The [Iterator] of [elements] provides the order of the elements.
+ *
+ * An unmodifiable list cannot have its length or elements changed.
+ * If the elements are themselves immutable, then the resulting list
+ * is also immutable.
+ */
+ external factory List.unmodifiable(Iterable elements);
+
+ /**
* Returns the object at the given [index] in the list
* or throws a [RangeError] if [index] is out of bounds.
*/

Powered by Google App Engine
This is Rietveld 408576698