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

Unified Diff: runtime/lib/array_patch.dart

Issue 10878077: Unify list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add issue number to TODO. Created 8 years, 4 months 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.dart ('k') | runtime/lib/lib_impl_sources.gypi » ('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
new file mode 100644
index 0000000000000000000000000000000000000000..502be94ebc1598164676d03b75a3cb8c9354f178
--- /dev/null
+++ b/runtime/lib/array_patch.dart
@@ -0,0 +1,21 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+patch class ListImplementation<E> {
+ /* patch */ factory List([int length = null]) {
+ if (length === null) {
+ return new GrowableObjectArray<E>();
+ } else {
+ return new ObjectArray<E>(length);
+ }
+ }
+
+ /* patch */ static _from(Iterable other) {
+ GrowableObjectArray list = new GrowableObjectArray();
+ for (final e in other) {
+ list.add(e);
+ }
+ return list;
+ }
+}
« no previous file with comments | « runtime/lib/array.dart ('k') | runtime/lib/lib_impl_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698