Chromium Code Reviews| Index: corelib/src/implementation/list.dart |
| diff --git a/corelib/src/implementation/list.dart b/corelib/src/implementation/list.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8d0fadec1a7ecc24fc3ecf41c1977edeeaaeab99 |
| --- /dev/null |
| +++ b/corelib/src/implementation/list.dart |
| @@ -0,0 +1,30 @@ |
| +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +/** |
| + * A [List] is an indexable collection with a length. It can be of |
| + * fixed size or extendable. |
| + */ |
| +class ListImplementation<E> { |
| + /** |
| + * Factory implementation of List(). |
| + * |
| + * Creates a list of the given [length]. |
| + */ |
| + external factory List([int length]); |
| + |
| + /** |
| + * Factory implementation of List.from(). |
| + * |
| + * Creates a list with the elements of [other]. The order in |
| + * the list will be the order provided by the iterator of [other]. |
| + */ |
| + factory List.from(Iterable<E> other) { |
| + // TODO(ajohnsen): Make external once the vm can handle it, so we don't |
|
Anders Johnsen
2012/08/27 13:56:45
Should I file a bug and add issue number here?
Mads Ager (google)
2012/08/27 14:02:42
Yes, please. Bug report that named factory constru
Anders Johnsen
2012/08/27 14:05:40
Done.
|
| + // lose generic type information. |
|
Mads Ager (google)
2012/08/27 14:02:42
But please lose the additional indentation here. D
Anders Johnsen
2012/08/27 14:05:40
Done.
|
| + return _from(other); |
| + } |
| + |
| + external static _from(Iterable<E> other); |
| +} |