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

Unified Diff: sdk/lib/async/stream_impl.dart

Issue 839323003: Implementation of async-await transformation on js ast. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added a few tests Created 5 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: sdk/lib/async/stream_impl.dart
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index 394e1c6a7c72b51b25fc7df35554941a94e2e2e5..eef9660404d6261e713bc8424eef0a4d01de0958 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -1036,7 +1036,10 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> {
} else {
_clear();
}
- return subscription.cancel();
+ // If the stream is done, the subscription will have been cleared.
+ return subscription == null
+ ? new _Future<Null>.immediate(null)
+ : subscription.cancel();
}
void _onData(T data) {

Powered by Google App Engine
This is Rietveld 408576698