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

Unified Diff: runtime/lib/array_patch.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
« no previous file with comments | « no previous file | runtime/lib/growable_array.cc » ('j') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array_patch.dart
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index 37c697c9d3ddd0524c7cf9a69f602e1de6e0323b..109938bf9d2070ce26c6688a610ce310c8c88365 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -48,6 +48,11 @@ patch class List<E> {
return makeListFixedLength(list);
}
+ /* patch */ factory List.unmodifiable(Iterable elements) {
+ List result = new List<E>.from(elements, growable: false);
+ return makeFixedListUnmodifiable(result);
+ }
+
// Factory constructing a mutable List from a parser generated List literal.
// [elements] contains elements that are already type checked.
factory List._fromLiteral(List elements) {
« no previous file with comments | « no previous file | runtime/lib/growable_array.cc » ('j') | sdk/lib/_internal/compiler/js_lib/js_array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698