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

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: 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
Index: lib/src/cancelable_operation.dart
diff --git a/lib/src/cancelable_operation.dart b/lib/src/cancelable_operation.dart
index 1ba6b3c4759f5b8477fb8740c51ad9c0dfb8cde5..ab8940b911ea0b6b4c39b375720e9188215c4fd5 100644
--- a/lib/src/cancelable_operation.dart
+++ b/lib/src/cancelable_operation.dart
@@ -62,9 +62,8 @@ 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();
+ completer.complete(value);
_completer._cancelMemo.future.then((_) {
completer.complete(cancellationValue);

Powered by Google App Engine
This is Rietveld 408576698