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

Unified Diff: runtime/lib/core_patch.dart

Issue 2563633002: Make the VM's dart:core and dart:async library patches clean. (Closed)
Patch Set: Make moveNextFn private. Created 4 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/core_patch.dart
diff --git a/runtime/lib/core_patch.dart b/runtime/lib/core_patch.dart
index 29357aec4d8fe7c873d5323cb5646c592c3cf382..fbcfdb9012985fcddca78ffe736dcc55d3e2b90b 100644
--- a/runtime/lib/core_patch.dart
+++ b/runtime/lib/core_patch.dart
@@ -25,16 +25,16 @@ class _EnumHelper {
// implement sync* generator functions. A sync* generator allocates
// and returns a new _SyncIterable object.
-typedef bool SyncGeneratorCallback(Iterator iterator);
+typedef bool _SyncGeneratorCallback(Iterator iterator);
class _SyncIterable extends IterableBase {
- // moveNextFn is the closurized body of the generator function.
- final SyncGeneratorCallback moveNextFn;
+ // _moveNextFn is the closurized body of the generator function.
+ final _SyncGeneratorCallback _moveNextFn;
- const _SyncIterable(this.moveNextFn);
+ const _SyncIterable(this._moveNextFn);
get iterator {
- return new _SyncIterator(moveNextFn._clone());
+ return new _SyncIterator(_moveNextFn._clone());
}
}
@@ -42,16 +42,16 @@ class _SyncIterator implements Iterator {
bool isYieldEach; // Set by generated code for the yield* statement.
Iterator yieldEachIterator;
var _current; // Set by generated code for the yield and yield* statement.
- SyncGeneratorCallback moveNextFn;
+ _SyncGeneratorCallback _moveNextFn;
get current => yieldEachIterator != null
? yieldEachIterator.current
: _current;
- _SyncIterator(this.moveNextFn);
+ _SyncIterator(this._moveNextFn);
bool moveNext() {
- if (moveNextFn == null) {
+ if (_moveNextFn == null) {
return false;
}
while(true) {
@@ -62,9 +62,9 @@ class _SyncIterator implements Iterator {
yieldEachIterator = null;
}
isYieldEach = false;
- // moveNextFn() will update the values of isYieldEach and _current.
- if (!moveNextFn(this)) {
- moveNextFn = null;
+ // _moveNextFn() will update the values of isYieldEach and _current.
+ if (!_moveNextFn(this)) {
+ _moveNextFn = null;
_current = null;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698