Chromium Code Reviews| 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 |
|
Anders Johnsen
2012/08/27 13:56:45
Is this the time to start calling them list, e.g.
Mads Ager (google)
2012/08/27 14:02:42
Let's do a cleanup sweep to do that?
Anders Johnsen
2012/08/27 14:05:40
Roger!
|
| +// 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; |
| + } |
| +} |