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

Unified Diff: pkg/intl/example/basic/basic_example.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/http/test/utils.dart ('k') | pkg/intl/lib/bidi_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/example/basic/basic_example.dart
diff --git a/pkg/intl/example/basic/basic_example.dart b/pkg/intl/example/basic/basic_example.dart
index 76380e90d12f8af6dd1481a092ade87936cc1b65..68ec594471931be4e05276f3c73e09e8e60b05fe 100644
--- a/pkg/intl/example/basic/basic_example.dart
+++ b/pkg/intl/example/basic/basic_example.dart
@@ -19,6 +19,7 @@ library intl_basic_example;
// These can be replaced with package:intl/... references if using this in
// a separate package.
// TODO(alanknight): Replace these with package: once pub works in buildbots.
+import 'dart:async';
import '../../lib/date_symbol_data_local.dart';
import '../../lib/intl.dart';
import '../../lib/message_lookup_local.dart';
@@ -57,8 +58,8 @@ runProgram(List<Future> _) {
printForLocale(aDate, de, runAt);
printForLocale(aDate, th, runAt);
// Example making use of the return value from withLocale;
- var useReturnValue = Intl.withLocale(th.locale, () => runAt('now', 'today'));
- doThisWithTheOutput(useReturnValue);
+ Intl.withLocale(th.locale, () => runAt('now', 'today'))
+ .then(doThisWithTheOutput);
}
printForLocale(aDate, intl, operation) {
@@ -66,5 +67,7 @@ printForLocale(aDate, intl, operation) {
var dayFormat = intl.date().add_yMMMMEEEEd();
var time = hmsFormat.format(aDate);
var day = dayFormat.format(aDate);
- Intl.withLocale(intl.locale, () { doThisWithTheOutput(operation(time,day));});
-}
+ Intl.withLocale(intl.locale, () {
+ operation(time,day).then(doThisWithTheOutput);
+ });
+}
« no previous file with comments | « pkg/http/test/utils.dart ('k') | pkg/intl/lib/bidi_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698