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

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

Issue 23793006: Handle Future result from Future.sync computation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: compromise Created 7 years, 3 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 | « no previous file | tests/lib/async/future_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future.dart
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 6b6c760dadb760119dcc4140a9ee492121fd5368..72918158b908691b61db201e27cd54cbd1742a90 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -128,7 +128,7 @@ abstract class Future<T> {
factory Future.sync(computation()) {
try {
var result = computation();
- return new Future<T>.value(result);
+ return new Future.value(result);
kevmoo-old 2013/09/17 17:21:41 After I did the update, I decided I don't like thi
floitsch 2013/09/17 17:59:44 This Future<T> is correct. But the Future.value sh
} catch (error, stackTrace) {
return new Future<T>.error(error, stackTrace);
}
@@ -365,7 +365,7 @@ abstract class Future<T> {
*
* If you already have a Future, you probably don't need a Completer.
* Instead, you can usually use [Future.then], which returns a Future:
- *
+ *
* Future doStuff(){
* return someAsyncOperation().then((result) {
* // Do something.
« no previous file with comments | « no previous file | tests/lib/async/future_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698