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

Unified Diff: src/i18n.cc

Issue 807313003: Crash with an error message when ICU data files are missing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/i18n.cc
diff --git a/src/i18n.cc b/src/i18n.cc
index ba44687aa90dd57932cc36f4feb3986004dac856..69fa9ca89583c45dcfd2e1a709894dc9baf3224a 100644
--- a/src/i18n.cc
+++ b/src/i18n.cc
@@ -704,6 +704,10 @@ icu::SimpleDateFormat* DateFormat::InitializeDateTimeFormat(
icu::Locale no_extension_locale(icu_locale.getBaseName());
date_format = CreateICUDateFormat(isolate, no_extension_locale, options);
+ if (!date_format) {
+ FATAL("Failed to create ICU date format, are ICU data files missing?");
+ }
+
// Set resolved settings (pattern, numbering system, calendar).
SetResolvedDateSettings(
isolate, no_extension_locale, date_format, resolved);
@@ -780,6 +784,10 @@ icu::DecimalFormat* NumberFormat::InitializeNumberFormat(
number_format = CreateICUNumberFormat(
isolate, no_extension_locale, options);
+ if (!number_format) {
+ FATAL("Failed to create ICU number format, are ICU data files missing?");
+ }
+
// Set resolved settings (pattern, numbering system).
SetResolvedNumberSettings(
isolate, no_extension_locale, number_format, resolved);
@@ -839,6 +847,10 @@ icu::Collator* Collator::InitializeCollator(
icu::Locale no_extension_locale(icu_locale.getBaseName());
collator = CreateICUCollator(isolate, no_extension_locale, options);
+ if (!collator) {
+ FATAL("Failed to create ICU collator, are ICU data files missing?");
+ }
+
// Set resolved settings (pattern, numbering system).
SetResolvedCollatorSettings(
isolate, no_extension_locale, collator, resolved);
@@ -898,6 +910,10 @@ icu::BreakIterator* BreakIterator::InitializeBreakIterator(
break_iterator = CreateICUBreakIterator(
isolate, no_extension_locale, options);
+ if (!break_iterator) {
+ FATAL("Failed to create ICU break iterator, are ICU data files missing?");
+ }
+
// Set resolved settings (locale).
SetResolvedBreakIteratorSettings(
isolate, no_extension_locale, break_iterator, resolved);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698