Commit 3f270f34 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[intl] Remove flag for Intl.DisplayNames

Intl.DisplayNames was shipped in m81 and we now can remove the flag.
https://www.chromestatus.com/features/4965112605573120


Bug: v8:8703
Change-Id: Ib65d787c1871aa1da38a22fdb9e369c680c7d2c9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2163820
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67382}
parent b4e4d415
...@@ -259,8 +259,7 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs) ...@@ -259,8 +259,7 @@ DEFINE_IMPLICATION(harmony_weak_refs_with_cleanup_some, harmony_weak_refs)
#define HARMONY_SHIPPING(V) \ #define HARMONY_SHIPPING(V) \
HARMONY_SHIPPING_BASE(V) \ HARMONY_SHIPPING_BASE(V) \
V(harmony_intl_dateformat_fractional_second_digits, \ V(harmony_intl_dateformat_fractional_second_digits, \
"Add fractionalSecondDigits option to DateTimeFormat") \ "Add fractionalSecondDigits option to DateTimeFormat")
V(harmony_intl_displaynames, "Intl.DisplayNames")
#else #else
#define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V) #define HARMONY_SHIPPING(V) HARMONY_SHIPPING_BASE(V)
#endif #endif
......
...@@ -3172,6 +3172,37 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object, ...@@ -3172,6 +3172,37 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
factory->numberingSystem_string(), factory->numberingSystem_string(),
Builtins::kLocalePrototypeNumberingSystem, true); Builtins::kLocalePrototypeNumberingSystem, true);
} }
{ // -- D i s p l a y N a m e s
Handle<JSFunction> display_names_fun = InstallFunction(
isolate(), intl, "DisplayNames", JS_DISPLAY_NAMES_TYPE,
JSDisplayNames::kHeaderSize, 0, factory->the_hole_value(),
Builtins::kDisplayNamesConstructor);
display_names_fun->shared().set_length(0);
display_names_fun->shared().DontAdaptArguments();
InstallWithIntrinsicDefaultProto(
isolate(), display_names_fun,
Context::INTL_DISPLAY_NAMES_FUNCTION_INDEX);
SimpleInstallFunction(isolate(), display_names_fun, "supportedLocalesOf",
Builtins::kDisplayNamesSupportedLocalesOf, 1,
false);
{
// Setup %DisplayNamesPrototype%.
Handle<JSObject> prototype(
JSObject::cast(display_names_fun->instance_prototype()), isolate());
InstallToStringTag(isolate(), prototype, "Intl.DisplayNames");
SimpleInstallFunction(isolate(), prototype, "resolvedOptions",
Builtins::kDisplayNamesPrototypeResolvedOptions,
0, false);
SimpleInstallFunction(isolate(), prototype, "of",
Builtins::kDisplayNamesPrototypeOf, 1, false);
}
}
} }
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
...@@ -4510,43 +4541,6 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() { ...@@ -4510,43 +4541,6 @@ void Genesis::InitializeGlobal_harmony_intl_segmenter() {
} }
} }
void Genesis::InitializeGlobal_harmony_intl_displaynames() {
if (!FLAG_harmony_intl_displaynames) return;
Handle<JSObject> intl = Handle<JSObject>::cast(
JSReceiver::GetProperty(
isolate(),
Handle<JSReceiver>(native_context()->global_object(), isolate()),
factory()->InternalizeUtf8String("Intl"))
.ToHandleChecked());
Handle<JSFunction> display_names_fun = InstallFunction(
isolate(), intl, "DisplayNames", JS_DISPLAY_NAMES_TYPE,
JSDisplayNames::kHeaderSize, 0, factory()->the_hole_value(),
Builtins::kDisplayNamesConstructor);
display_names_fun->shared().set_length(0);
display_names_fun->shared().DontAdaptArguments();
InstallWithIntrinsicDefaultProto(isolate_, display_names_fun,
Context::INTL_DISPLAY_NAMES_FUNCTION_INDEX);
SimpleInstallFunction(isolate(), display_names_fun, "supportedLocalesOf",
Builtins::kDisplayNamesSupportedLocalesOf, 1, false);
{
// Setup %DisplayNamesPrototype%.
Handle<JSObject> prototype(
JSObject::cast(display_names_fun->instance_prototype()), isolate());
InstallToStringTag(isolate(), prototype, "Intl.DisplayNames");
SimpleInstallFunction(isolate(), prototype, "resolvedOptions",
Builtins::kDisplayNamesPrototypeResolvedOptions, 0,
false);
SimpleInstallFunction(isolate(), prototype, "of",
Builtins::kDisplayNamesPrototypeOf, 1, false);
}
}
#endif // V8_INTL_SUPPORT #endif // V8_INTL_SUPPORT
Handle<JSFunction> Genesis::CreateArrayBuffer( Handle<JSFunction> Genesis::CreateArrayBuffer(
......
...@@ -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-displaynames
// Throws only once during construction. // Throws only once during construction.
// Check for all getters to prevent regression. // Check for all getters to prevent regression.
// Preserve the order of getter initialization. // Preserve the order of getter initialization.
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +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-displaynames
// DisplayNames constructor can't be called as function. // DisplayNames constructor can't be called as function.
assertThrows(() => Intl.DisplayNames('sr'), TypeError); assertThrows(() => Intl.DisplayNames('sr'), TypeError);
......
...@@ -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-displaynames
let displayNames = new Intl.DisplayNames(); let displayNames = new Intl.DisplayNames();
// The default style is 'long' // The default style is 'long'
assertEquals('long', displayNames.resolvedOptions().style); assertEquals('long', displayNames.resolvedOptions().style);
......
...@@ -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-displaynames
assertEquals(typeof Intl.DisplayNames.supportedLocalesOf, "function", assertEquals(typeof Intl.DisplayNames.supportedLocalesOf, "function",
"Intl.DisplayNames.supportedLocalesOf should be a function"); "Intl.DisplayNames.supportedLocalesOf should be a function");
......
...@@ -48,7 +48,6 @@ FEATURE_FLAGS = { ...@@ -48,7 +48,6 @@ FEATURE_FLAGS = {
'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', 'Intl.DateTimeFormat-fractionalSecondDigits': '--harmony-intl-dateformat-fractional-second-digits',
'Intl.DisplayNames': '--harmony-intl-displaynames',
'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