[Intl] Remove flag for fractionalSecondDigits

DateTimeFormat's fractionalSecondDigits shipped in M84, so we
can drop the --harmony_intl_dateformat_fractional_second_digits
flag now.

Bug: v8:10485
Change-Id: If7a1a8599722073d7382635219a6fb46cdc47474
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2311410
Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69007}
This commit is contained in:
Frank Tang 2020-07-21 16:21:56 -07:00 committed by Commit Bot
parent b1761b06f7
commit 6f356f799b
6 changed files with 16 additions and 38 deletions

View File

@ -262,14 +262,7 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs)
V(harmony_string_replaceall, "harmony String.prototype.replaceAll") \
V(harmony_logical_assignment, "harmony logical assignment")
#ifdef V8_INTL_SUPPORT
#define HARMONY_SHIPPING(V) \
HARMONY_SHIPPING_BASE(V) \
V(harmony_intl_dateformat_fractional_second_digits, \
"Add fractionalSecondDigits option to DateTimeFormat")
#else
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif
// Once a shipping feature has proved stable in the wild, it will be dropped
// from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,

View File

@ -4126,8 +4126,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_logical_assignment)
#ifdef V8_INTL_SUPPORT
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_displaynames_date_types)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_dateformat_day_period)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(
harmony_intl_dateformat_fractional_second_digits)
#endif // V8_INTL_SUPPORT
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE

View File

@ -640,14 +640,12 @@ MaybeHandle<JSObject> JSDateTimeFormat::ResolvedOptions(
}
}
}
if (FLAG_harmony_intl_dateformat_fractional_second_digits) {
int fsd = FractionalSecondDigitsFromPattern(pattern);
if (fsd > 0) {
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->fractionalSecondDigits_string(),
factory->NewNumberFromInt(fsd), Just(kDontThrow))
.FromJust());
}
int fsd = FractionalSecondDigitsFromPattern(pattern);
if (fsd > 0) {
CHECK(JSReceiver::CreateDataProperty(
isolate, options, factory->fractionalSecondDigits_string(),
factory->NewNumberFromInt(fsd), Just(kDontThrow))
.FromJust());
}
}
@ -893,9 +891,7 @@ MaybeHandle<JSObject> JSDateTimeFormat::ToDateTimeOptions(
list.push_back(factory->hour_string());
list.push_back(factory->minute_string());
list.push_back(factory->second_string());
if (FLAG_harmony_intl_dateformat_fractional_second_digits) {
list.push_back(factory->fractionalSecondDigits_string());
}
list.push_back(factory->fractionalSecondDigits_string());
Maybe<bool> maybe_needs_default = NeedsDefault(isolate, options, list);
MAYBE_RETURN(maybe_needs_default, Handle<JSObject>());
needs_default &= maybe_needs_default.FromJust();
@ -1660,17 +1656,15 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
skeleton += item.map.find(input.get())->second;
}
}
if (FLAG_harmony_intl_dateformat_fractional_second_digits) {
// Let _value_ be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3,
// *undefined*). The *undefined* is represented by value 0 here.
Maybe<int> maybe_fsd = Intl::GetNumberOption(
isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0);
MAYBE_RETURN(maybe_fsd, MaybeHandle<JSDateTimeFormat>());
// Convert fractionalSecondDigits to skeleton.
int fsd = maybe_fsd.FromJust();
for (int i = 0; i < fsd; i++) {
skeleton += "S";
}
// Let _value_ be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3,
// *undefined*). The *undefined* is represented by value 0 here.
Maybe<int> maybe_fsd = Intl::GetNumberOption(
isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0);
MAYBE_RETURN(maybe_fsd, MaybeHandle<JSDateTimeFormat>());
// Convert fractionalSecondDigits to skeleton.
int fsd = maybe_fsd.FromJust();
for (int i = 0; i < fsd; i++) {
skeleton += "S";
}
// 29. Let matcher be ? GetOption(options, "formatMatcher", "string", «

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony_intl_dateformat_fractional_second_digits
assertThrows(
() => (new Intl.DateTimeFormat("en", {fractionalSecondDigits: 0})),
RangeError,

View File

@ -62,10 +62,6 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=4709
'language/expressions/assignment/fn-name-lhs-cover': [FAIL],
# https://github.com/tc39/test262/issues/2591
'intl402/DateTimeFormat/prototype/resolvedOptions/order': ['--no-harmony-intl_dateformat_fractional_second_digits'],
'intl402/DateTimeFormat/prototype/resolvedOptions/order-dayPeriod': ['--no-harmony-intl_dateformat_fractional_second_digits'],
# https://bugs.chromium.org/p/v8/issues/detail?id=9084
'intl402/supportedLocalesOf-consistent-with-resolvedOptions': [FAIL],
'intl402/fallback-locales-are-supported': [FAIL],

View File

@ -47,7 +47,6 @@ FEATURE_FLAGS = {
'Intl.Segmenter': '--harmony-intl-segmenter',
'Intl.DateTimeFormat-dayPeriod': '--harmony-intl-dateformat-day-period',
'Intl.DateTimeFormat-quarter': '--harmony-intl-dateformat-quarter',
'Intl.DateTimeFormat-fractionalSecondDigits': '--harmony-intl-dateformat-fractional-second-digits',
'String.prototype.replaceAll': '--harmony_string_replaceall',
'Symbol.prototype.description': '--harmony-symbol-description',
'export-star-as-namespace-from-module': '--harmony-namespace-exports',