Files
sdk/runtime/lib/array_patch.dart
T
ajohnsen@google.com 660f03288e Unify list.
I've added a TODO that we'll have to address asap. This patch will
currently limit the checks being performed with List.from(other).

BUG=

Review URL: https://chromiumcodereview.appspot.com//10878077

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11384 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 14:06:03 +00:00

22 lines
618 B
Dart

// 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;
}
}