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

Unified Diff: tests/compiler/dart2js_extra/for_in_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
Index: tests/compiler/dart2js_extra/for_in_test.dart
diff --git a/tests/compiler/dart2js_extra/for_in_test.dart b/tests/compiler/dart2js_extra/for_in_test.dart
index d2f76ea94f79682a54c13e3b3ffc6396b669e312..0083115f1abc36ebf972eb86a8159980f1893f6a 100644
--- a/tests/compiler/dart2js_extra/for_in_test.dart
+++ b/tests/compiler/dart2js_extra/for_in_test.dart
@@ -23,10 +23,10 @@ testIterator(List expect, Iterable input) {
Expect.equals(expect.length, i);
}
-class MyIterable<T> implements Iterable<T> {
+class MyIterable<T> extends Iterable<T> {
final List<T> values;
MyIterable(List<T> values) : this.values = values;
- Iterator iterator() {
+ Iterator get iterator {
return new MyListIterator(values);
}
}
@@ -34,9 +34,10 @@ class MyIterable<T> implements Iterable<T> {
class MyListIterator<T> implements Iterator<T> {
final List<T> values;
int index;
- MyListIterator(List<T> values) : this.values = values, index = 0;
- bool get hasNext => index < values.length;
- T next() => values[index++];
+ MyListIterator(List<T> values) : this.values = values, index = -1;
+
+ bool moveNext() => ++index < values.length;
+ T current() => (0 <= index && index < length) ? values[index] : null;
}
void main() {
« no previous file with comments | « tests/compiler/dart2js/value_range_test.dart ('k') | tests/compiler/dart2js_extra/invalid_length_negative_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698