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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 12545056: Make stream subscription more lax wrt. calling methods on it after it's completed. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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:
Download patch
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 0f07ca96b9208a8af3a36809553888bb23cf3d9d..21fa7bb788cc0a580aa3ac7c4eaaf0f915c29d33 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -31049,9 +31049,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
}
void cancel() {
- if (_canceled) {
- throw new StateError("Subscription has been canceled.");
- }
+ if (_canceled) return;
_unlisten();
// Clear out the target to indicate this is complete.
@@ -31079,9 +31077,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
void onDone(void handleDone()) {}
void pause([Future resumeSignal]) {
- if (_canceled) {
- throw new StateError("Subscription has been canceled.");
- }
+ if (_canceled) return;
++_pauseCount;
_unlisten();
@@ -31093,12 +31089,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
bool get _paused => _pauseCount > 0;
void resume() {
- if (_canceled) {
- throw new StateError("Subscription has been canceled.");
- }
- if (!_paused) {
- throw new StateError("Subscription is not paused.");
- }
+ if (_canceled || !_paused) return;
--_pauseCount;
_tryResume();
}
« no previous file with comments | « sdk/lib/async/stream_pipe.dart ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698