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

Unified Diff: pkg/intl/lib/intl_standalone.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | « pkg/intl/lib/intl_browser.dart ('k') | pkg/oauth2/lib/src/client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/lib/intl_standalone.dart
diff --git a/pkg/intl/lib/intl_standalone.dart b/pkg/intl/lib/intl_standalone.dart
index e40126ff5d2af02872044ce6de0482ba6ca0e464..fe70ccfbdbf9b5b60dd04f33efa73399050a9470 100644
--- a/pkg/intl/lib/intl_standalone.dart
+++ b/pkg/intl/lib/intl_standalone.dart
@@ -43,7 +43,7 @@ Future<String> findSystemLocale() {
return _getAppleDefaults();
}
// We can't find anything, don't set the system locale and return null.
- return new Future.immediate(null);
+ return new Future.value();
}
/**
@@ -83,12 +83,12 @@ Future _getAppleDefaults() {
* then don't set the variable and return a future that completes with null.
*/
Future<String> _checkResult(ProcessResult result, RegExp regex) {
- if (result.exitCode != 0) return new Future.immediate(null);
+ if (result.exitCode != 0) return new Future.value();
var match = regex.firstMatch(result.stdout);
- if (match == null) return new Future.immediate(null);
+ if (match == null) return new Future.value();
var locale = match.group(1);
_setLocale(locale);
- return new Future.immediate(locale);
+ return new Future.value(locale);
}
/**
@@ -96,5 +96,5 @@ Future<String> _checkResult(ProcessResult result, RegExp regex) {
*/
Future<String> _setLocale(aLocale) {
Intl.systemLocale = Intl.canonicalizedLocale(aLocale);
- return new Future.immediate(Intl.systemLocale);
+ return new Future.value(Intl.systemLocale);
}
« no previous file with comments | « pkg/intl/lib/intl_browser.dart ('k') | pkg/oauth2/lib/src/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698