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

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

Issue 2762953003: More minor type improvements in dart:async. (Closed)
Patch Set: More fixes. Created 3 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_impl.dart
diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
index 164d3b242802874e9d1d4e2cbffaeaf6438a3d68..9ae7342d65038f9e12ebb3be3f50742d8e0dfa18 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -343,13 +343,14 @@ class _BufferingStreamSubscription<T>
// future to finish we must not report the error.
if (_isCanceled && !_waitsForCancel) return;
_state |= _STATE_IN_CALLBACK;
+ // TODO(floitsch): this dynamic should be 'void'.
if (_onError is ZoneBinaryCallback<dynamic, Object, StackTrace>) {
ZoneBinaryCallback<dynamic, Object, StackTrace> errorCallback = _onError
as Object/*=ZoneBinaryCallback<dynamic, Object, StackTrace>*/;
_zone.runBinaryGuarded(errorCallback, error, stackTrace);
} else {
- _zone.runUnaryGuarded<dynamic, dynamic>(
- _onError as Object/*=ZoneUnaryCallback<dynamic, dynamic>*/, error);
+ _zone.runUnaryGuarded<dynamic, Object>(
+ _onError as Object/*=ZoneUnaryCallback<dynamic, Object>*/, error);
}
_state &= ~_STATE_IN_CALLBACK;
}
@@ -401,7 +402,7 @@ class _BufferingStreamSubscription<T>
* during the call, and it checks for state changes after the call
* that should cause further callbacks.
*/
- void _guardCallback(callback) {
+ void _guardCallback(void callback()) {
assert(!_inCallback);
bool wasInputPaused = _isInputPaused;
_state |= _STATE_IN_CALLBACK;
@@ -551,10 +552,10 @@ typedef void _DataHandler<T>(T value);
typedef void _DoneHandler();
/** Default data handler, does nothing. */
-void _nullDataHandler(var value) {}
+void _nullDataHandler(Object value) {}
/** Default error handler, reports the error to the current zone's handler. */
-void _nullErrorHandler(error, [StackTrace stackTrace]) {
+void _nullErrorHandler(Object error, [StackTrace stackTrace]) {
Zone.current.handleUncaughtError(error, stackTrace);
}
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | sdk/lib/async/stream_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698