[intl] Clean up
Remove two flags for feature shipped in m95 --harmony_intl_displaynames_v2 --harmony_intl_more_timezone Bug: v8:11637, v8:11661 Change-Id: I9432865722664f64c64b5bf7fde5e05e6b324b20 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3292518 Reviewed-by: Shu-yu Guo <syg@chromium.org> Commit-Queue: Frank Tang <ftang@chromium.org> Cr-Commit-Position: refs/heads/main@{#78005}
This commit is contained in:
parent
a9b74cff05
commit
bd4fa32c87
@ -344,11 +344,7 @@ DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony features")
|
||||
V(harmony_array_find_last, "harmony array find last helpers")
|
||||
|
||||
#ifdef V8_INTL_SUPPORT
|
||||
#define HARMONY_SHIPPING(V) \
|
||||
HARMONY_SHIPPING_BASE(V) \
|
||||
V(harmony_intl_displaynames_v2, "Intl.DisplayNames v2") \
|
||||
V(harmony_intl_more_timezone, \
|
||||
"Extend Intl.DateTimeFormat timeZoneName Option")
|
||||
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
|
||||
#else
|
||||
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
|
||||
#endif
|
||||
|
@ -4381,8 +4381,6 @@ EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_error_cause)
|
||||
|
||||
#ifdef V8_INTL_SUPPORT
|
||||
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_best_fit_matcher)
|
||||
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_displaynames_v2)
|
||||
EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE(harmony_intl_more_timezone)
|
||||
#endif // V8_INTL_SUPPORT
|
||||
|
||||
#undef EMPTY_INITIALIZE_GLOBAL_FOR_FEATURE
|
||||
|
@ -168,7 +168,6 @@ static std::vector<PatternItem> BuildPatternItems() {
|
||||
items.push_back(PatternItem("second", {{"ss", "2-digit"}, {"s", "numeric"}},
|
||||
k2DigitNumeric));
|
||||
|
||||
if (FLAG_harmony_intl_more_timezone) {
|
||||
const std::vector<const char*> kTimezone = {"long", "short",
|
||||
"longOffset", "shortOffset",
|
||||
"longGeneric", "shortGeneric"};
|
||||
@ -180,11 +179,7 @@ static std::vector<PatternItem> BuildPatternItems() {
|
||||
{"vvvv", "longGeneric"},
|
||||
{"v", "shortGeneric"}},
|
||||
kTimezone));
|
||||
} else {
|
||||
items.push_back(PatternItem(
|
||||
"timeZoneName", {{"zzzz", "long"}, {"z", "short"}}, kLongShort));
|
||||
}
|
||||
return items;
|
||||
return items;
|
||||
}
|
||||
|
||||
class PatternItems {
|
||||
|
@ -454,24 +454,12 @@ MaybeHandle<JSDisplayNames> JSDisplayNames::New(Isolate* isolate,
|
||||
// 12. Let type be ? GetOption(options, "type", "string", « "language",
|
||||
// "region", "script", "currency" , "calendar", "dateTimeField", "unit"»,
|
||||
// undefined).
|
||||
Maybe<Type> maybe_type =
|
||||
FLAG_harmony_intl_displaynames_v2
|
||||
? GetStringOption<Type>(
|
||||
isolate, options, "type", service,
|
||||
{"language", "region", "script", "currency", "calendar",
|
||||
"dateTimeField"},
|
||||
{Type::kLanguage, Type::kRegion, Type::kScript, Type::kCurrency,
|
||||
Type::kCalendar, Type::kDateTimeField},
|
||||
Type::kUndefined)
|
||||
: GetStringOption<Type>(isolate, options, "type", service,
|
||||
{"language", "region", "script", "currency"},
|
||||
{
|
||||
Type::kLanguage,
|
||||
Type::kRegion,
|
||||
Type::kScript,
|
||||
Type::kCurrency,
|
||||
},
|
||||
Type::kUndefined);
|
||||
Maybe<Type> maybe_type = GetStringOption<Type>(
|
||||
isolate, options, "type", service,
|
||||
{"language", "region", "script", "currency", "calendar", "dateTimeField"},
|
||||
{Type::kLanguage, Type::kRegion, Type::kScript, Type::kCurrency,
|
||||
Type::kCalendar, Type::kDateTimeField},
|
||||
Type::kUndefined);
|
||||
MAYBE_RETURN(maybe_type, MaybeHandle<JSDisplayNames>());
|
||||
Type type_enum = maybe_type.FromJust();
|
||||
|
||||
@ -494,21 +482,18 @@ MaybeHandle<JSDisplayNames> JSDisplayNames::New(Isolate* isolate,
|
||||
// 16. Set displayNames.[[Fallback]] to fallback.
|
||||
|
||||
LanguageDisplay language_display_enum = LanguageDisplay::kDialect;
|
||||
if (FLAG_harmony_intl_displaynames_v2) {
|
||||
// 24. Let languageDisplay be ? GetOption(options, "languageDisplay",
|
||||
// "string", « "dialect", "standard" », "dialect").
|
||||
Maybe<LanguageDisplay> maybe_language_display =
|
||||
GetStringOption<LanguageDisplay>(
|
||||
isolate, options, "languageDisplay", service,
|
||||
{"dialect", "standard"},
|
||||
{LanguageDisplay::kDialect, LanguageDisplay::kStandard},
|
||||
LanguageDisplay::kDialect);
|
||||
MAYBE_RETURN(maybe_language_display, MaybeHandle<JSDisplayNames>());
|
||||
// 25. If type is "language", then
|
||||
if (type_enum == Type::kLanguage) {
|
||||
// a. Set displayNames.[[LanguageDisplay]] to languageDisplay.
|
||||
language_display_enum = maybe_language_display.FromJust();
|
||||
}
|
||||
// 24. Let languageDisplay be ? GetOption(options, "languageDisplay",
|
||||
// "string", « "dialect", "standard" », "dialect").
|
||||
Maybe<LanguageDisplay> maybe_language_display =
|
||||
GetStringOption<LanguageDisplay>(
|
||||
isolate, options, "languageDisplay", service, {"dialect", "standard"},
|
||||
{LanguageDisplay::kDialect, LanguageDisplay::kStandard},
|
||||
LanguageDisplay::kDialect);
|
||||
MAYBE_RETURN(maybe_language_display, MaybeHandle<JSDisplayNames>());
|
||||
// 25. If type is "language", then
|
||||
if (type_enum == Type::kLanguage) {
|
||||
// a. Set displayNames.[[LanguageDisplay]] to languageDisplay.
|
||||
language_display_enum = maybe_language_display.FromJust();
|
||||
}
|
||||
|
||||
// Set displayNames.[[Fallback]] to fallback.
|
||||
@ -596,7 +581,6 @@ Handle<JSObject> JSDisplayNames::ResolvedOptions(
|
||||
DCHECK(maybe_create_fallback.FromJust());
|
||||
USE(maybe_create_fallback);
|
||||
|
||||
if (FLAG_harmony_intl_displaynames_v2) {
|
||||
if (std::strcmp("language", internal->type()) == 0) {
|
||||
Maybe<bool> maybe_create_language_display =
|
||||
JSReceiver::CreateDataProperty(isolate, options,
|
||||
@ -605,7 +589,6 @@ Handle<JSObject> JSDisplayNames::ResolvedOptions(
|
||||
DCHECK(maybe_create_language_display.FromJust());
|
||||
USE(maybe_create_language_display);
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
@ -1,8 +1,6 @@
|
||||
// Copyright 2021 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
// Flags: --harmony_intl_more_timezone
|
||||
|
||||
// Tests time zone names.
|
||||
|
||||
// Winter date (PST).
|
||||
|
@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.islamic'
|
||||
|
||||
// Flags: --harmony_intl_displaynames_v2
|
||||
|
||||
const calendars = [
|
||||
'buddhist', 'chinese', 'coptic', 'dangi', 'ethioaa', 'ethiopic-amete-alem',
|
||||
'ethiopic', 'gregory', 'hebrew', 'indian', 'islamic', 'islamic-umalqura',
|
||||
|
@ -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_displaynames_v2
|
||||
|
||||
// Throws only once during construction.
|
||||
// Check for all getters to prevent regression.
|
||||
// Preserve the order of getter initialization.
|
||||
|
@ -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_displaynames_v2
|
||||
|
||||
assertDoesNotThrow(
|
||||
() => new Intl.DisplayNames(
|
||||
'sr', {type: 'calendar'}));
|
||||
|
@ -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_displaynames_v2
|
||||
|
||||
const dateTimeFields = [
|
||||
'era', 'year', 'quarter', 'month', 'weekOfYear', 'weekday', 'day',
|
||||
'dayPeriod', 'hour', 'minute', 'second', 'timeZoneName'
|
||||
|
@ -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_displaynames_v2
|
||||
|
||||
let displayNames = new Intl.DisplayNames(undefined, {type: 'language'});
|
||||
// The default languageDisplay is 'dialect' if type is 'language'
|
||||
assertEquals('dialect', displayNames.resolvedOptions().languageDisplay);
|
||||
|
@ -45,8 +45,6 @@ from testrunner.outproc import test262
|
||||
# TODO(littledan): move the flag mapping into the status file
|
||||
FEATURE_FLAGS = {
|
||||
'Intl.Locale-info': '--harmony_intl_locale_info',
|
||||
'Intl.DateTimeFormat-extend-timezonename': '--harmony_intl_more_timezone',
|
||||
'Intl.DisplayNames-v2': '--harmony_intl_displaynames_v2',
|
||||
'Intl-enumeration': '--harmony_intl_enumeration',
|
||||
'Symbol.prototype.description': '--harmony-symbol-description',
|
||||
'FinalizationRegistry': '--harmony-weak-refs-with-cleanup-some',
|
||||
|
Loading…
Reference in New Issue
Block a user