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

Unified Diff: tool/input_sdk/lib/internal/list.dart

Issue 1939093003: List.unmodifiable (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: /*<E>*/ 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
« no previous file with comments | « tool/input_sdk/lib/core/list.dart ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/input_sdk/lib/internal/list.dart
diff --git a/tool/input_sdk/lib/internal/list.dart b/tool/input_sdk/lib/internal/list.dart
index 3e87762c317d2dfd1f93a16e81e2868126809f24..36322034efa5cac3b53040fe9d81e483b45c3c00 100644
--- a/tool/input_sdk/lib/internal/list.dart
+++ b/tool/input_sdk/lib/internal/list.dart
@@ -361,7 +361,7 @@ abstract class NonGrowableListError {
* That means that it is a destructive conversion.
* The original list should not be used afterwards.
*
- * The returned list may be the same list as the orginal,
+ * The returned list may be the same list as the original,
* or it may be a different list (according to [identical]).
* The original list may have changed type to be a fixed list,
* or become empty or been otherwise modified.
@@ -373,4 +373,21 @@ abstract class NonGrowableListError {
* conversion, at the cost of leaving the original list in an unspecified
* state.
*/
-external List makeListFixedLength(List growableList);
+external List/*<E>*/ makeListFixedLength/*<E>*/(List/*<E>*/ growableList);
+
+/**
+ * Converts a fixed-length list to an unmodifiable list.
+ *
+ * For internal use only.
+ * Only works for core fixed-length lists as created by `new List(length)`,
+ * or as returned by [makeListFixedLength].
+ *
+ * The operation is efficient. It doesn't copy the elements, but converts
+ * the existing list directly to a fixed length list.
+ * That means that it is a destructive conversion.
+ * The original list should not be used afterwards.
+ *
+ * The unmodifiable list type is similar to the one used by const lists.
+ */
+external List/*<E>*/ makeFixedListUnmodifiable/*<E>*/(
+ List/*<E>*/ fixedLengthList);
« no previous file with comments | « tool/input_sdk/lib/core/list.dart ('k') | tool/input_sdk/patch/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698