Reviewers: Sven Panne,
Description:
Crash with an error message when ICU data files are missing
Before, we'd just crash.
BUG=v8:3348
[email protected]
LOG=n
Please review this at https://codereview.chromium.org/807313003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+16, -0 lines):
M src/i18n.cc
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);
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.