Commit 43f44e53 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Remove abandoned support of 'quarter'

ECMA402 decided to abandon https://github.com/tc39/ecma402/pull/345
so we should remove the code here.

Bug: v8:9282
Change-Id: I05cbad429ae01bf3debebfed07160b5f53f98a21
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1825827
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64004}
parent bd61b5b0
......@@ -214,7 +214,6 @@ DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import)
#ifdef V8_INTL_SUPPORT
#define HARMONY_INPROGRESS(V) \
HARMONY_INPROGRESS_BASE(V) \
V(harmony_intl_dateformat_quarter, "Add quarter option to DateTimeFormat") \
V(harmony_intl_other_calendars, "DateTimeFormat other calendars")
#else
#define HARMONY_INPROGRESS(V) HARMONY_INPROGRESS_BASE(V)
......
......@@ -4314,7 +4314,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_add_calendar_numbering_system)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_dateformat_day_period)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(
harmony_intl_dateformat_fractional_second_digits)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_dateformat_quarter)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_other_calendars)
#endif // V8_INTL_SUPPORT
......
......@@ -79,16 +79,6 @@ static std::vector<PatternItem> BuildPatternItems() {
kNarrowLongShort),
PatternItem("year", {{"yy", "2-digit"}, {"y", "numeric"}},
k2DigitNumeric)};
if (FLAG_harmony_intl_dateformat_quarter) {
items.push_back(PatternItem("quarter",
{{"QQQQQ", "narrow"},
{"QQQQ", "long"},
{"QQQ", "short"},
{"qqqqq", "narrow"},
{"qqqq", "long"},
{"qqq", "short"}},
kNarrowLongShort));
}
// Sometimes we get L instead of M for month - standalone name.
items.push_back(PatternItem("month",
{{"MMMMM", "narrow"},
......@@ -777,13 +767,10 @@ MaybeHandle<JSObject> JSDateTimeFormat::ToDateTimeOptions(
// 4. If required is "date" or "any", then
if (required == RequiredOption::kAny || required == RequiredOption::kDate) {
// a. For each of the property names "weekday", "year", "quarter", "month",
// a. For each of the property names "weekday", "year", "month",
// "day", do
std::vector<Handle<String>> list(
{factory->weekday_string(), factory->year_string()});
if (FLAG_harmony_intl_dateformat_quarter) {
list.push_back(factory->quarter_string());
}
list.push_back(factory->month_string());
list.push_back(factory->day_string());
Maybe<bool> maybe_needs_default = NeedsDefault(isolate, options, list);
......@@ -1583,9 +1570,6 @@ Handle<String> IcuDateFieldIdToDateType(int32_t field_id, Isolate* isolate) {
case UDAT_YEAR_FIELD:
case UDAT_EXTENDED_YEAR_FIELD:
return isolate->factory()->year_string();
case UDAT_QUARTER_FIELD:
case UDAT_STANDALONE_QUARTER_FIELD:
return isolate->factory()->quarter_string();
case UDAT_YEAR_NAME_FIELD:
return isolate->factory()->yearName_string();
case UDAT_MONTH_FIELD:
......@@ -1624,6 +1608,9 @@ Handle<String> IcuDateFieldIdToDateType(int32_t field_id, Isolate* isolate) {
return isolate->factory()->fractionalSecond_string();
case UDAT_RELATED_YEAR_FIELD:
return isolate->factory()->relatedYear_string();
case UDAT_QUARTER_FIELD:
case UDAT_STANDALONE_QUARTER_FIELD:
default:
// Other UDAT_*_FIELD's cannot show up because there is no way to specify
// them via options of Intl.DateTimeFormat.
......
......@@ -527,6 +527,9 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=9612
'intl402/DateTimeFormat/prototype/formatRange/fractionalSecondDigits': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=9282
'intl402/DateTimeFormat/constructor-options-throwing-getters-quarter': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=9613
'intl402/Intl/getCanonicalLocales/canonicalized-tags': [FAIL],
'intl402/Intl/getCanonicalLocales/grandfathered': [FAIL],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment