| Index: sdk/lib/internal/list.dart
|
| diff --git a/sdk/lib/internal/list.dart b/sdk/lib/internal/list.dart
|
| index 14eeb1372ee8c050a5bb69528bee6d3e72e9496c..f40c39bffaeee7fa1076ac781f5cd17bca242912 100644
|
| --- a/sdk/lib/internal/list.dart
|
| +++ b/sdk/lib/internal/list.dart
|
| @@ -305,3 +305,29 @@ class ReversedListIterable<E> extends ListIterable<E> {
|
|
|
| E elementAt(int index) => _source.elementAt(_source.length - 1 - index);
|
| }
|
| +
|
| +/**
|
| + * Converts a growable list to a fixed length list with the same elements.
|
| + *
|
| + * For internal use only.
|
| + * Only works on growable lists as created by `[]` or `new List()`.
|
| + * May throw on any other list.
|
| + *
|
| + * 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 returned list may be the same list as the orginal,
|
| + * 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.
|
| + * It will still be a valid object, so references to it will not, e.g., crash
|
| + * the runtime if accessed, but no promises are made wrt. its contents.
|
| + *
|
| + * This unspecified behavior is the reason the function is not exposed to
|
| + * users. We allow the underlying implementation to make the most efficient
|
| + * conversion, at the cost of leaving the original list in an unspecified
|
| + * state.
|
| + */
|
| +external List makeListFixedLength(List growableList);
|
|
|