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

Unified Diff: sdk/lib/_internal/compiler/js_lib/core_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
Index: sdk/lib/_internal/compiler/js_lib/core_patch.dart
diff --git a/sdk/lib/_internal/compiler/js_lib/core_patch.dart b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
index cca8f160a01ff847e8ad9a73bec5d0c6764cc57c..a3f151312f3ba21692967657af164c8164aa9acb 100644
--- a/sdk/lib/_internal/compiler/js_lib/core_patch.dart
+++ b/sdk/lib/_internal/compiler/js_lib/core_patch.dart
@@ -279,8 +279,13 @@ class List<E> {
if (growable) return list;
return makeListFixedLength(list);
}
-}
+ @patch
+ factory List.unmodifiable(Iterable elements) {
+ List result = new List<E>.from(elements, growable: false);
+ return makeFixedListUnmodifiable(result);
+ }
+}
@patch
class String {

Powered by Google App Engine
This is Rietveld 408576698