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

Unified Diff: lib/src/cancelable_operation.dart

Issue 1841223002: Fix most strong mode warnings. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Code review changes Created 4 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 | « lib/src/async_memoizer.dart ('k') | lib/src/delegate/future.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/cancelable_operation.dart
diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart
index 1ba6b3c4759f5b8477fb8740c51ad9c0dfb8cde5..d0a1871f43dab4798ff39a7ad7763c9c5ec2373a 100644
--- a/lib/src/cancelable_operation.dart
+++ b/lib/src/cancelable_operation.dart
@@ -62,9 +62,9 @@ class CancelableOperation<T> {
/// If this operation is cancelled, the returned future waits for the future
/// returned by [cancel], then completes to [cancellationValue].
Future valueOrCancellation([T cancellationValue]) {
- var completer = new Completer.sync();
-
- value.then(completer.complete, onError: completer.completeError);
+ var completer = new Completer<T>.sync();
+ value.then((result) => completer.complete(result),
+ onError: completer.completeError);
_completer._cancelMemo.future.then((_) {
completer.complete(cancellationValue);
« no previous file with comments | « lib/src/async_memoizer.dart ('k') | lib/src/delegate/future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698