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

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

Issue 12316036: Merge IO v2 branch to bleeding edge (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
Index: sdk/lib/async/stream_impl.dart
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index bbfc98ebb90661fd96348873c1ae0f6a34ced1ae..7d59cc7ed7420d3f95387ec579b42d3242ccd899 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -123,7 +123,7 @@ abstract class _StreamImpl<T> extends Stream<T> {
* should be the last message sent.
*/
void _close() {
- if (_isClosed) throw new StateError("Sending on closed stream");
+ if (_isClosed) return;
Mads Ager (google) 2013/02/21 10:39:02 We should land this file on bleeding_edge. It is a
Søren Gjesse 2013/02/21 11:44:25 Anders did.
_state |= _STREAM_CLOSED;
if (!_canFireEvent) {
// You can't enqueue an event after the Done, so make it const.
@@ -310,6 +310,8 @@ abstract class _StreamImpl<T> extends Stream<T> {
*
* If an event is currently firing, the cancel is delayed
* until after the subscribers have received the event.
+ *
+ * This will also close the stream.
*/
void _cancel(_StreamSubscriptionImpl subscriber);

Powered by Google App Engine
This is Rietveld 408576698