Commit 6f356f79 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[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/+/2311410Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69007}
parent b1761b06
...@@ -262,14 +262,7 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) ...@@ -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_string_replaceall, "harmony String.prototype.replaceAll") \
V(harmony_logical_assignment, "harmony logical assignment") 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) #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif
// Once a shipping feature has proved stable in the wild, it will be dropped // 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, // from HARMONY_SHIPPING, all occurrences of the FLAG_ variable are removed,
......
...@@ -4126,8 +4126,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_logical_assignment) ...@@ -4126,8 +4126,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_logical_assignment)
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_displaynames_date_types) 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_day_period)
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(
harmony_intl_dateformat_fractional_second_digits)
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE #undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE
......
...@@ -640,14 +640,12 @@ MaybeHandle<JSObject> JSDateTimeFormat::ResolvedOptions( ...@@ -640,14 +640,12 @@ MaybeHandle<JSObject> JSDateTimeFormat::ResolvedOptions(
} }
} }
} }
if (FLAG_harmony_intl_dateformat_fractional_second_digits) { int fsd = FractionalSecondDigitsFromPattern(pattern);
int fsd = FractionalSecondDigitsFromPattern(pattern); if (fsd > 0) {
if (fsd > 0) { CHECK(JSReceiver::CreateDataProperty(
CHECK(JSReceiver::CreateDataProperty( isolate, options, factory->fractionalSecondDigits_string(),
isolate, options, factory->fractionalSecondDigits_string(), factory->NewNumberFromInt(fsd), Just(kDontThrow))
factory->NewNumberFromInt(fsd), Just(kDontThrow)) .FromJust());
.FromJust());
}
} }
} }
...@@ -893,9 +891,7 @@ MaybeHandle<JSObject> JSDateTimeFormat::ToDateTimeOptions( ...@@ -893,9 +891,7 @@ MaybeHandle<JSObject> JSDateTimeFormat::ToDateTimeOptions(
list.push_back(factory->hour_string()); list.push_back(factory->hour_string());
list.push_back(factory->minute_string()); list.push_back(factory->minute_string());
list.push_back(factory->second_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<bool> maybe_needs_default = NeedsDefault(isolate, options, list);
MAYBE_RETURN(maybe_needs_default, Handle<JSObject>()); MAYBE_RETURN(maybe_needs_default, Handle<JSObject>());
needs_default &= maybe_needs_default.FromJust(); needs_default &= maybe_needs_default.FromJust();
...@@ -1660,17 +1656,15 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New( ...@@ -1660,17 +1656,15 @@ MaybeHandle<JSDateTimeFormat> JSDateTimeFormat::New(
skeleton += item.map.find(input.get())->second; skeleton += item.map.find(input.get())->second;
} }
} }
if (FLAG_harmony_intl_dateformat_fractional_second_digits) { // Let _value_ be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3,
// Let _value_ be ? GetNumberOption(options, "fractionalSecondDigits", 1, 3, // *undefined*). The *undefined* is represented by value 0 here.
// *undefined*). The *undefined* is represented by value 0 here. Maybe<int> maybe_fsd = Intl::GetNumberOption(
Maybe<int> maybe_fsd = Intl::GetNumberOption( isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0);
isolate, options, factory->fractionalSecondDigits_string(), 1, 3, 0); MAYBE_RETURN(maybe_fsd, MaybeHandle<JSDateTimeFormat>());
MAYBE_RETURN(maybe_fsd, MaybeHandle<JSDateTimeFormat>()); // Convert fractionalSecondDigits to skeleton.
// Convert fractionalSecondDigits to skeleton. int fsd = maybe_fsd.FromJust();
int fsd = maybe_fsd.FromJust(); for (int i = 0; i < fsd; i++) {
for (int i = 0; i < fsd; i++) { skeleton += "S";
skeleton += "S";
}
} }
// 29. Let matcher be ? GetOption(options, "formatMatcher", "string", « // 29. Let matcher be ? GetOption(options, "formatMatcher", "string", «
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// Flags: --harmony_intl_dateformat_fractional_second_digits
assertThrows( assertThrows(
() => (new Intl.DateTimeFormat("en", {fractionalSecondDigits: 0})), () => (new Intl.DateTimeFormat("en", {fractionalSecondDigits: 0})),
RangeError, RangeError,
......
...@@ -62,10 +62,6 @@ ...@@ -62,10 +62,6 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=4709 # https://bugs.chromium.org/p/v8/issues/detail?id=4709
'language/expressions/assignment/fn-name-lhs-cover': [FAIL], '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 # https://bugs.chromium.org/p/v8/issues/detail?id=9084
'intl402/supportedLocalesOf-consistent-with-resolvedOptions': [FAIL], 'intl402/supportedLocalesOf-consistent-with-resolvedOptions': [FAIL],
'intl402/fallback-locales-are-supported': [FAIL], 'intl402/fallback-locales-are-supported': [FAIL],
......
...@@ -47,7 +47,6 @@ FEATURE_FLAGS = { ...@@ -47,7 +47,6 @@ FEATURE_FLAGS = {
'Intl.Segmenter': '--harmony-intl-segmenter', 'Intl.Segmenter': '--harmony-intl-segmenter',
'Intl.DateTimeFormat-dayPeriod': '--harmony-intl-dateformat-day-period', 'Intl.DateTimeFormat-dayPeriod': '--harmony-intl-dateformat-day-period',
'Intl.DateTimeFormat-quarter': '--harmony-intl-dateformat-quarter', 'Intl.DateTimeFormat-quarter': '--harmony-intl-dateformat-quarter',
'Intl.DateTimeFormat-fractionalSecondDigits': '--harmony-intl-dateformat-fractional-second-digits',
'String.prototype.replaceAll': '--harmony_string_replaceall', 'String.prototype.replaceAll': '--harmony_string_replaceall',
'Symbol.prototype.description': '--harmony-symbol-description', 'Symbol.prototype.description': '--harmony-symbol-description',
'export-star-as-namespace-from-module': '--harmony-namespace-exports', 'export-star-as-namespace-from-module': '--harmony-namespace-exports',
......
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