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

Unified Diff: sdk/lib/core/list.dart

Issue 1440663003: Add "growable" parameter to List.filled constructor. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | tests/corelib/growable_list_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/list.dart
diff --git a/sdk/lib/core/list.dart b/sdk/lib/core/list.dart
index 50a5f58901bea7d31a094ae93c6740a39fe4b5b7..7f4ab18dfdf63bcf9b125b670926e5703ba3a713 100644
--- a/sdk/lib/core/list.dart
+++ b/sdk/lib/core/list.dart
@@ -82,9 +82,14 @@ abstract class List<E> implements Iterable<E>, EfficientLength {
*
* new List<int>.filled(3, 0); // [0, 0, 0]
*
- * The [length] must not be negative or null.
+ * The [length] must be a non-negative integer.
+ *
+ * If the list is growable, changing its length will not initialize new
+ * entries with [fill]. After being created and filled, the list is
+ * no different from any other growable or fixed-length list
+ * created using [List].
*/
- external factory List.filled(int length, E fill);
+ external factory List.filled(int length, E fill, {bool growable: false});
/**
* Creates a list containing all [elements].
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/core_patch.dart ('k') | tests/corelib/growable_list_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698