[Intl] Remove harmony-locale flag
harmony-locale is shipped in m74 and m74 is already out. Remove harmony-locale flag from the code. Bug: v8:8910 Change-Id: If9634b6767cfe449cfa03980bbad26ceb7408c79 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1592465 Commit-Queue: Frank Tang <ftang@chromium.org> Reviewed-by: Adam Klein <adamk@chromium.org> Cr-Commit-Position: refs/heads/master@{#61429}
This commit is contained in:
parent
efdc544ab0
commit
377f182b48
@ -3060,6 +3060,52 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
|
||||
Builtins::kListFormatPrototypeFormatToParts, 1,
|
||||
false);
|
||||
}
|
||||
|
||||
{ // -- L o c a l e
|
||||
Handle<JSFunction> locale_fun = InstallFunction(
|
||||
isolate(), intl, "Locale", JS_INTL_LOCALE_TYPE, JSLocale::kSize, 0,
|
||||
factory->the_hole_value(), Builtins::kLocaleConstructor);
|
||||
InstallWithIntrinsicDefaultProto(isolate(), locale_fun,
|
||||
Context::INTL_LOCALE_FUNCTION_INDEX);
|
||||
locale_fun->shared()->set_length(1);
|
||||
locale_fun->shared()->DontAdaptArguments();
|
||||
|
||||
// Setup %LocalePrototype%.
|
||||
Handle<JSObject> prototype(
|
||||
JSObject::cast(locale_fun->instance_prototype()), isolate());
|
||||
|
||||
InstallToStringTag(isolate(), prototype, "Intl.Locale");
|
||||
|
||||
SimpleInstallFunction(isolate(), prototype, "toString",
|
||||
Builtins::kLocalePrototypeToString, 0, false);
|
||||
SimpleInstallFunction(isolate(), prototype, "maximize",
|
||||
Builtins::kLocalePrototypeMaximize, 0, false);
|
||||
SimpleInstallFunction(isolate(), prototype, "minimize",
|
||||
Builtins::kLocalePrototypeMinimize, 0, false);
|
||||
// Base locale getters.
|
||||
SimpleInstallGetter(isolate(), prototype, factory->language_string(),
|
||||
Builtins::kLocalePrototypeLanguage, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->script_string(),
|
||||
Builtins::kLocalePrototypeScript, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->region_string(),
|
||||
Builtins::kLocalePrototypeRegion, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->baseName_string(),
|
||||
Builtins::kLocalePrototypeBaseName, true);
|
||||
// Unicode extension getters.
|
||||
SimpleInstallGetter(isolate(), prototype, factory->calendar_string(),
|
||||
Builtins::kLocalePrototypeCalendar, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->caseFirst_string(),
|
||||
Builtins::kLocalePrototypeCaseFirst, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->collation_string(),
|
||||
Builtins::kLocalePrototypeCollation, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->hourCycle_string(),
|
||||
Builtins::kLocalePrototypeHourCycle, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory->numeric_string(),
|
||||
Builtins::kLocalePrototypeNumeric, true);
|
||||
SimpleInstallGetter(isolate(), prototype,
|
||||
factory->numberingSystem_string(),
|
||||
Builtins::kLocalePrototypeNumberingSystem, true);
|
||||
}
|
||||
}
|
||||
#endif // V8_INTL_SUPPORT
|
||||
|
||||
@ -4380,60 +4426,6 @@ void Genesis::InitializeGlobal_harmony_intl_date_format_range() {
|
||||
false);
|
||||
}
|
||||
|
||||
void Genesis::InitializeGlobal_harmony_locale() {
|
||||
if (!FLAG_harmony_locale) return;
|
||||
|
||||
Handle<JSObject> intl = Handle<JSObject>::cast(
|
||||
JSReceiver::GetProperty(
|
||||
isolate(),
|
||||
Handle<JSReceiver>(native_context()->global_object(), isolate()),
|
||||
factory()->InternalizeUtf8String("Intl"))
|
||||
.ToHandleChecked());
|
||||
|
||||
Handle<JSFunction> locale_fun = InstallFunction(
|
||||
isolate(), intl, "Locale", JS_INTL_LOCALE_TYPE, JSLocale::kSize, 0,
|
||||
factory()->the_hole_value(), Builtins::kLocaleConstructor);
|
||||
InstallWithIntrinsicDefaultProto(isolate(), locale_fun,
|
||||
Context::INTL_LOCALE_FUNCTION_INDEX);
|
||||
locale_fun->shared()->set_length(1);
|
||||
locale_fun->shared()->DontAdaptArguments();
|
||||
|
||||
// Setup %LocalePrototype%.
|
||||
Handle<JSObject> prototype(JSObject::cast(locale_fun->instance_prototype()),
|
||||
isolate());
|
||||
|
||||
InstallToStringTag(isolate(), prototype, "Intl.Locale");
|
||||
|
||||
SimpleInstallFunction(isolate(), prototype, "toString",
|
||||
Builtins::kLocalePrototypeToString, 0, false);
|
||||
SimpleInstallFunction(isolate(), prototype, "maximize",
|
||||
Builtins::kLocalePrototypeMaximize, 0, false);
|
||||
SimpleInstallFunction(isolate(), prototype, "minimize",
|
||||
Builtins::kLocalePrototypeMinimize, 0, false);
|
||||
// Base locale getters.
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->language_string(),
|
||||
Builtins::kLocalePrototypeLanguage, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->script_string(),
|
||||
Builtins::kLocalePrototypeScript, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->region_string(),
|
||||
Builtins::kLocalePrototypeRegion, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->baseName_string(),
|
||||
Builtins::kLocalePrototypeBaseName, true);
|
||||
// Unicode extension getters.
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->calendar_string(),
|
||||
Builtins::kLocalePrototypeCalendar, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->caseFirst_string(),
|
||||
Builtins::kLocalePrototypeCaseFirst, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->collation_string(),
|
||||
Builtins::kLocalePrototypeCollation, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->hourCycle_string(),
|
||||
Builtins::kLocalePrototypeHourCycle, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->numeric_string(),
|
||||
Builtins::kLocalePrototypeNumeric, true);
|
||||
SimpleInstallGetter(isolate(), prototype, factory()->numberingSystem_string(),
|
||||
Builtins::kLocalePrototypeNumberingSystem, true);
|
||||
}
|
||||
|
||||
void Genesis::InitializeGlobal_harmony_intl_segmenter() {
|
||||
if (!FLAG_harmony_intl_segmenter) return;
|
||||
Handle<JSObject> intl = Handle<JSObject>::cast(
|
||||
|
@ -248,11 +248,10 @@ DEFINE_IMPLICATION(harmony_import_meta, harmony_dynamic_import)
|
||||
V(harmony_promise_all_settled, "harmony Promise.allSettled")
|
||||
|
||||
#ifdef V8_INTL_SUPPORT
|
||||
#define HARMONY_SHIPPING(V) \
|
||||
HARMONY_SHIPPING_BASE(V) \
|
||||
V(harmony_intl_bigint, "BigInt.prototype.toLocaleString") \
|
||||
V(harmony_intl_datetime_style, "dateStyle timeStyle for DateTimeFormat") \
|
||||
V(harmony_locale, "Intl.Locale")
|
||||
#define HARMONY_SHIPPING(V) \
|
||||
HARMONY_SHIPPING_BASE(V) \
|
||||
V(harmony_intl_bigint, "BigInt.prototype.toLocaleString") \
|
||||
V(harmony_intl_datetime_style, "dateStyle timeStyle for DateTimeFormat")
|
||||
#else
|
||||
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
|
||||
#endif
|
||||
|
@ -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-locale
|
||||
//
|
||||
// Test NumberFormat will accept Intl.Locale as first parameter, or
|
||||
// as in the array.
|
||||
|
||||
|
@ -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-locale
|
||||
|
||||
// Make sure that locale string got canonicalized by the spec,
|
||||
// keys are sorted and unique, region upper cased, script title cased and
|
||||
// language lower cased.
|
||||
|
@ -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-locale
|
||||
|
||||
// Locale constructor can't be called as function.
|
||||
assertThrows(() => Intl.Locale('sr'), TypeError);
|
||||
|
||||
|
@ -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-locale
|
||||
|
||||
// Make sure that locale exposes all required properties. Those not specified
|
||||
// should have undefined value.
|
||||
|
||||
|
@ -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-locale
|
||||
|
||||
// Make sure that maximize and minimize of all locales work reasonbly.
|
||||
|
||||
assertEquals(new Intl.Locale("zh-TW").maximize().toString(), "zh-Hant-TW",
|
||||
|
@ -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-locale
|
||||
|
||||
// Make sure that accessing locale property will return undefined instead of
|
||||
// crash.
|
||||
|
||||
|
@ -2,6 +2,4 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-locale
|
||||
|
||||
assertThrows(() => new Intl.Locale(''), RangeError);
|
||||
|
@ -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-locale
|
||||
|
||||
// Make sure that maximize and minimize of locales work reasonbly.
|
||||
|
||||
assertEquals("zh-Hans-CN-u-ca-chinese", new Intl.Locale("zh-u-ca-Chinese").maximize().toString());
|
||||
|
@ -2,6 +2,4 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-locale
|
||||
|
||||
assertDoesNotThrow(() => new Intl.Locale('und'));
|
||||
|
@ -47,7 +47,6 @@ FEATURE_FLAGS = {
|
||||
'numeric-separator-literal': '--harmony-numeric-separator',
|
||||
'Intl.DateTimeFormat-datetimestyle': '--harmony-intl-datetime-style',
|
||||
'Intl.DateTimeFormat-formatRange': '--harmony-intl-date-format-range',
|
||||
'Intl.Locale': '--harmony-locale',
|
||||
'Intl.Segmenter': '--harmony-intl-segmenter',
|
||||
'Symbol.prototype.description': '--harmony-symbol-description',
|
||||
'globalThis': '--harmony-global',
|
||||
|
Loading…
Reference in New Issue
Block a user