Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: sdk/lib/core/list.dart

Issue 50733002: Update List constructor documentation. Say that null is not a length. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of dart.core; 5 part of dart.core;
6 6
7 /** 7 /**
8 * An indexable collection of objects with a length. 8 * An indexable collection of objects with a length.
9 * 9 *
10 * Subclasses of this class implement different kinds of lists. 10 * Subclasses of this class implement different kinds of lists.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 * fixedLengthList.length; // 3 53 * fixedLengthList.length; // 3
54 * fixedLengthList.length = 1; // Error 54 * fixedLengthList.length = 1; // Error
55 * 55 *
56 * 56 *
57 * The list has length 0 and is growable if [length] is omitted. 57 * The list has length 0 and is growable if [length] is omitted.
58 * 58 *
59 * List growableList = new List(); 59 * List growableList = new List();
60 * growableList.length; // 0; 60 * growableList.length; // 0;
61 * growableList.length = 3; 61 * growableList.length = 3;
62 * 62 *
63 * An error occurs if [length] is negative. 63 * The [length] must not be negative or null, if it is provided.
ngeoffray 2013/10/29 12:13:50 -> Throws an [ArgumentError] if [length] is provid
Lasse Reichstein Nielsen 2013/10/29 12:18:51 I'd rather not say how it fails. It will most like
64 */ 64 */
65 external factory List([int length]); 65 external factory List([int length]);
66 66
67 /** 67 /**
68 * Creates a fixed-length list of the given length, and initializes the 68 * Creates a fixed-length list of the given length, and initializes the
69 * value at each position with [fill]: 69 * value at each position with [fill]:
70 * 70 *
71 * new List<int>.filled(3, 0); // [0, 0, 0] 71 * new List<int>.filled(3, 0); // [0, 0, 0]
72 *
73 * The [length] must not be negative or null.
ngeoffray 2013/10/29 12:13:50 -> Throws an [ArgumentError] if [length] is negati
72 */ 74 */
73 external factory List.filled(int length, E fill); 75 external factory List.filled(int length, E fill);
74 76
75 /** 77 /**
76 * Creates a list and initializes it using the contents of [other]. 78 * Creates a list and initializes it using the contents of [other].
77 * 79 *
78 * The [Iterator] of [other] provides the order of the objects. 80 * The [Iterator] of [other] provides the order of the objects.
79 * 81 *
80 * This constructor returns a growable list if [growable] is true; 82 * This constructor returns a growable list if [growable] is true;
81 * otherwise, it returns a fixed-length list. 83 * otherwise, it returns a fixed-length list.
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 * as values. The `Map.keys` [Iterable] iterates the indices of this list 438 * as values. The `Map.keys` [Iterable] iterates the indices of this list
437 * in numerical order. 439 * in numerical order.
438 * 440 *
439 * List<String> words = ['fee', 'fi', 'fo', 'fum']; 441 * List<String> words = ['fee', 'fi', 'fo', 'fum'];
440 * Map<int, String> map = words.asMap(); 442 * Map<int, String> map = words.asMap();
441 * map[0] + map[1]; // 'feefi'; 443 * map[0] + map[1]; // 'feefi';
442 * map.keys.toList(); // [0, 1, 2, 3] 444 * map.keys.toList(); // [0, 1, 2, 3]
443 */ 445 */
444 Map<int, E> asMap(); 446 Map<int, E> asMap();
445 } 447 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698