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

Unified Diff: sdk/lib/html/dartium/html_dartium.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/html/dart2js/html_dart2js.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index 431511acecd016f7d2677189d30f4af4cda02245..27ced8bda4bc4f38e7e0ccbed34614982e79340b 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -33354,9 +33354,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.
@@ -33384,9 +33382,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();
@@ -33398,12 +33394,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/html/dart2js/html_dart2js.dart ('k') | tools/dom/src/EventStreamProvider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698