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

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

Issue 179783004: Verify the default locale in case we're given an invalid one and need to fall back. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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: pkg/intl/lib/intl.dart
diff --git a/pkg/intl/lib/intl.dart b/pkg/intl/lib/intl.dart
index 871fdc903aad7903873fa6c6d1d33001f8186c87..e6a3c7cec3738a756ccdc36e2b38d20e072b29fc 100644
--- a/pkg/intl/lib/intl.dart
+++ b/pkg/intl/lib/intl.dart
@@ -192,7 +192,10 @@ class Intl {
// difficult. As a result, we call this more often. Consider keeping
// verified locales for each purpose if it turns out to be a performance
// issue.
- if (newLocale == null) return getCurrentLocale();
+ if (newLocale == null) {
+ return verifiedLocale(getCurrentLocale(), localeExists,
+ onFailure: onFailure);
+ }
if (localeExists(newLocale)) {
return newLocale;
}

Powered by Google App Engine
This is Rietveld 408576698