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

Unified Diff: runtime/lib/array_patch.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 | « no previous file | sdk/lib/_internal/js_runtime/lib/core_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/array_patch.dart
diff --git a/runtime/lib/array_patch.dart b/runtime/lib/array_patch.dart
index abe5a193d4aaa9eec261487476bef350ee05b875..c0ddfeec1c35bdde3963c3b31b4d8107b0650c84 100644
--- a/runtime/lib/array_patch.dart
+++ b/runtime/lib/array_patch.dart
@@ -20,10 +20,10 @@ patch class List<E> {
return new _List<E>(length);
}
- /* patch */ factory List.filled(int length, E fill) {
+ /* patch */ factory List.filled(int length, E fill, {bool growable: false}) {
// All error handling on the length parameter is done at the implementation
// of new _List.
- var result = new _List<E>(length);
+ var result = growable ? new _GrowableList<E>(length) : new _List<E>(length);
if (fill != null) {
for (int i = 0; i < length; i++) {
result[i] = fill;
« no previous file with comments | « no previous file | sdk/lib/_internal/js_runtime/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698