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

Side by Side Diff: test/dart_codegen/expect/collection/iterator.dart

Issue 967933005: rename ddc -> dev_compiler, fixes #84 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 part of dart.collection; 1 part of dart.collection;
2 class HasNextIterator<E> {static const int _HAS_NEXT_AND_NEXT_IN_CURRENT = 0; 2 class HasNextIterator<E> {static const int _HAS_NEXT_AND_NEXT_IN_CURRENT = 0;
3 static const int _NO_NEXT = 1; 3 static const int _NO_NEXT = 1;
4 static const int _NOT_MOVED_YET = 2; 4 static const int _NOT_MOVED_YET = 2;
5 Iterator _iterator; 5 Iterator _iterator;
6 int _state = _NOT_MOVED_YET; 6 int _state = _NOT_MOVED_YET;
7 HasNextIterator(this._iterator); 7 HasNextIterator(this._iterator);
8 bool get hasNext { 8 bool get hasNext {
9 if (_state == _NOT_MOVED_YET) _move(); 9 if (_state == _NOT_MOVED_YET) _move();
10 return _state == _HAS_NEXT_AND_NEXT_IN_CURRENT; 10 return _state == _HAS_NEXT_AND_NEXT_IN_CURRENT;
11 } 11 }
12 E next() { 12 E next() {
13 if (!hasNext) throw new StateError("No more elements"); 13 if (!hasNext) throw new StateError("No more elements");
14 assert (_state == _HAS_NEXT_AND_NEXT_IN_CURRENT); E result = DDC$RT.cast(_ite rator.current, dynamic, E, "CastGeneral", """line 33, column 16 of dart:collecti on/iterator.dart: """, _iterator.current is E, false); 14 assert (_state == _HAS_NEXT_AND_NEXT_IN_CURRENT); E result = DEVC$RT.cast(_it erator.current, dynamic, E, "CastGeneral", """line 33, column 16 of dart:collect ion/iterator.dart: """, _iterator.current is E, false);
15 _move(); 15 _move();
16 return result; 16 return result;
17 } 17 }
18 void _move() { 18 void _move() {
19 if (_iterator.moveNext()) { 19 if (_iterator.moveNext()) {
20 _state = _HAS_NEXT_AND_NEXT_IN_CURRENT; 20 _state = _HAS_NEXT_AND_NEXT_IN_CURRENT;
21 } 21 }
22 else { 22 else {
23 _state = _NO_NEXT; 23 _state = _NO_NEXT;
24 } 24 }
25 } 25 }
26 } 26 }
OLDNEW
« no previous file with comments | « test/dart_codegen/expect/collection/iterable.dart ('k') | test/dart_codegen/expect/collection/linked_hash_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698