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..5e14295310955484bbc043246a1c8f311d4e7c23 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,24 @@ abstract class NonGrowableListError { |
* conversion, at the cost of leaving the original list in an unspecified |
* state. |
*/ |
+// TODO(sra): Find a way to declare this as (List<E>) -> List<E> without passing |
+// a type parameter. |
external List makeListFixedLength(List growableList); |
vsm
2016/05/02 23:56:12
Make this generic?
List/*<T>*/ makeListFixedLength
|
+ |
+/** |
+ * 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. |
+ */ |
+// TODO(sra): Find a way to declare this as (List<E>) -> List<E> without passing |
+// a type parameter. |
+external List makeFixedListUnmodifiable(List fixedLengthList); |
vsm
2016/05/02 23:56:12
Ditto?
|