OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
2 // for details. All rights reserved. Use of this source code is governed by a | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 /** | |
6 * A [List] is an indexable collection with a length. It can be of | |
7 * fixed size or extendable. | |
8 */ | |
9 class ListImplementation<E> { | |
10 /** | |
11 * Factory implementation of List(). | |
12 * | |
13 * Creates a list of the given [length]. | |
14 */ | |
15 external factory List([int length]); | |
16 | |
17 /** | |
18 * Factory implementation of List.from(). | |
19 * | |
20 * Creates a list with the elements of [other]. The order in | |
21 * the list will be the order provided by the iterator of [other]. | |
22 */ | |
23 factory List.from(Iterable<E> other) { | |
24 // TODO(ajohnsen): Make external once the vm can handle it, so we don't | |
25 // lose generic type information. | |
26 // Issue: #4727 | |
27 return _from(other); | |
28 } | |
29 | |
30 external static List _from(Iterable other); | |
31 } | |
OLD | NEW |