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

Unified Diff: sdk/lib/_internal/js_runtime/lib/core_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 | « runtime/lib/array_patch.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/js_runtime/lib/core_patch.dart
diff --git a/sdk/lib/_internal/js_runtime/lib/core_patch.dart b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
index d55524211342d233eaaec77493a5b3ad8833a037..301517ee669f5a532008375f12048c4f37bc0ba0 100644
--- a/sdk/lib/_internal/js_runtime/lib/core_patch.dart
+++ b/sdk/lib/_internal/js_runtime/lib/core_patch.dart
@@ -281,8 +281,9 @@ class List<E> {
}
@patch
- factory List.filled(int length, E fill) {
- List result = new JSArray<E>.fixed(length);
+ factory List.filled(int length, E fill, {bool growable: false}) {
+ List result = growable ? new JSArray<E>.growable(length)
+ : new JSArray<E>.fixed(length);
if (length != 0 && fill != null) {
for (int i = 0; i < result.length; i++) {
result[i] = fill;
« no previous file with comments | « runtime/lib/array_patch.dart ('k') | sdk/lib/core/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698