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

Unified Diff: tool/input_sdk/patch/core_patch.dart

Issue 1939093003: List.unmodifiable (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 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: tool/input_sdk/patch/core_patch.dart
diff --git a/tool/input_sdk/patch/core_patch.dart b/tool/input_sdk/patch/core_patch.dart
index 52ddebdc8205f0098a60387800b92fa3c3ca3566..bc8f193d25c4214271a911ba0621ae251c1d10d2 100644
--- a/tool/input_sdk/patch/core_patch.dart
+++ b/tool/input_sdk/patch/core_patch.dart
@@ -266,6 +266,12 @@ 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);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698