Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A [List] is an indexable collection with a length. It can be of | 6 * A [List] is an indexable collection with a length. It can be of |
| 7 * fixed size or extendable. | 7 * fixed size or extendable. |
| 8 */ | 8 */ |
| 9 class ListImplementation<E> { | 9 class ListImplementation<E> { |
| 10 /** | 10 /** |
| 11 * Factory implementation of List(). | 11 * Factory implementation of List(). |
| 12 * | 12 * |
| 13 * Creates a list of the given [length]. | 13 * Creates a list of the given [length]. |
| 14 */ | 14 */ |
| 15 external factory List([int length]); | 15 external factory List([int length]); |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Factory implementation of List.from(). | 18 * Factory implementation of List.from(). |
| 19 * | 19 * |
| 20 * Creates a list with the elements of [other]. The order in | 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]. | 21 * the list will be the order provided by the iterator of [other]. |
| 22 */ | 22 */ |
| 23 factory List.from(Iterable<E> other) { | 23 factory List.from(Iterable<E> other) { |
| 24 // TODO(ajohnsen): Make external once the vm can handle it, so we don't | 24 // TODO(ajohnsen): Make external once the vm can handle it, so we don't |
| 25 // lose generic type information. | 25 // lose generic type information. |
| 26 // Issue: #4727 | 26 // Issue: #4727 |
| 27 return _from(other); | 27 return _from(other); |
| 28 } | 28 } |
| 29 | 29 |
| 30 external static _from(Iterable<E> other); | 30 external static List _from(Iterable<E> other); |
|
ahe
2012/09/17 07:35:04
<E> is wrong here. It is just a bogus type annotat
Anders Johnsen
2012/09/17 07:53:07
Ivan fixed http://code.google.com/p/dart/issues/de
Lasse Reichstein Nielsen
2012/09/17 11:32:43
Yes, please!
Johnni Winther
2012/09/19 09:03:30
I guess I'll let you do that. Not really into writ
| |
| 31 } | 31 } |
| OLD | NEW |