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

Unified Diff: runtime/lib/array.dart

Issue 8921033: Implement revised factories in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
Index: runtime/lib/array.dart
===================================================================
--- runtime/lib/array.dart (revision 2391)
+++ runtime/lib/array.dart (working copy)
@@ -2,9 +2,9 @@
// 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.
-class ListFactory {
+class ListFactory<T> {
- factory List<T>.from(Iterable<T> other) {
+ factory List.from(Iterable<T> other) {
GrowableObjectArray<T> list = new GrowableObjectArray<T>();
for (final e in other) {
list.add(e);
@@ -12,7 +12,7 @@
return list;
}
- factory List<T>([int length = null]) {
+ factory List([int length = null]) {
if (length === null) {
return new GrowableObjectArray<T>();
} else {
@@ -24,7 +24,7 @@
// TODO(srdjan): Use shared array implementation.
class ObjectArray<T> implements List<T> {
- factory ObjectArray<T>(int length) native "ObjectArray_allocate";
+ factory ObjectArray(int length) native "ObjectArray_allocate";
T operator [](int index) native "ObjectArray_getIndexed";
@@ -161,7 +161,7 @@
// the inline cache misses.
class ImmutableArray<T> implements List<T> {
- factory ImmutableArray<T>._uninstantiable() {
+ factory ImmutableArray._uninstantiable() {
throw const UnsupportedOperationException(
"ImmutableArray can only be allocated by the VM");
}

Powered by Google App Engine
This is Rietveld 408576698