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

Unified Diff: dart/frog/leg/lib/mockimpl.dart

Issue 9355031: Improve List implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and resolved conflicts Created 8 years, 10 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 | « dart/frog/leg/lib/mock.dart ('k') | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/mockimpl.dart
diff --git a/dart/frog/leg/lib/mockimpl.dart b/dart/frog/leg/lib/mockimpl.dart
index 5840bd4eece3c7a363925357792fb4fead177e6e..81c204e4d4c5965ff1e67a24d6827ee84f6852c7 100644
--- a/dart/frog/leg/lib/mockimpl.dart
+++ b/dart/frog/leg/lib/mockimpl.dart
@@ -484,3 +484,16 @@ class DateImplementation implements Date {
return adjustedSeconds * Duration.MILLISECONDS_PER_SECOND + milliseconds;
}
}
+
+class ListFactory<E> implements List<E> {
+ factory List([int length]) => Primitives.newList(length);
+ factory List.from(Iterable<E> other) {
+ List<E> result = new List<E>();
+ // TODO(ahe): Use for-in when it is implemented correctly.
+ Iterator<E> iterator = other.iterator();
+ while (iterator.hasNext()) {
+ result.add(iterator.next());
+ }
+ return result;
+ }
+}
« no previous file with comments | « dart/frog/leg/lib/mock.dart ('k') | dart/frog/leg/scanner/scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698