Commit ba3a9424 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Changes of toStringTag of Intl.*

Implement the spec changes in https://github.com/tc39/ecma402/pull/430

Bug: v8:10554
Change-Id: I421d6feb94810027cf17ff58a4ec5357940ef44a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2212889Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68119}
parent 38948b8e
......@@ -2775,7 +2775,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSObject> prototype(
JSObject::cast(date_time_format_constructor->prototype()), isolate_);
InstallToStringTag(isolate_, prototype, factory->Object_string());
InstallToStringTag(isolate_, prototype, "Intl.DateTimeFormat");
SimpleInstallFunction(isolate_, prototype, "resolvedOptions",
Builtins::kDateTimeFormatPrototypeResolvedOptions,
......@@ -2814,7 +2814,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSObject> prototype(
JSObject::cast(number_format_constructor->prototype()), isolate_);
InstallToStringTag(isolate_, prototype, factory->Object_string());
InstallToStringTag(isolate_, prototype, "Intl.NumberFormat");
SimpleInstallFunction(isolate_, prototype, "resolvedOptions",
Builtins::kNumberFormatPrototypeResolvedOptions, 0,
......@@ -2842,7 +2842,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSObject> prototype(
JSObject::cast(collator_constructor->prototype()), isolate_);
InstallToStringTag(isolate_, prototype, factory->Object_string());
InstallToStringTag(isolate_, prototype, "Intl.Collator");
SimpleInstallFunction(isolate_, prototype, "resolvedOptions",
Builtins::kCollatorPrototypeResolvedOptions, 0,
......@@ -2905,7 +2905,7 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Handle<JSObject> prototype(
JSObject::cast(plural_rules_constructor->prototype()), isolate_);
InstallToStringTag(isolate_, prototype, factory->Object_string());
InstallToStringTag(isolate_, prototype, "Intl.PluralRules");
SimpleInstallFunction(isolate_, prototype, "resolvedOptions",
Builtins::kPluralRulesPrototypeResolvedOptions, 0,
......
......@@ -7,7 +7,7 @@ let descriptor;
descriptor = Object.getOwnPropertyDescriptor(Intl.DateTimeFormat.prototype,
Symbol.toStringTag);
assertEquals("Object", descriptor.value);
assertEquals("Intl.DateTimeFormat", descriptor.value);
assertFalse(descriptor.writable);
assertFalse(descriptor.enumerable);
assertTrue(descriptor.configurable);
......@@ -15,7 +15,7 @@ assertTrue(descriptor.configurable);
descriptor = Object.getOwnPropertyDescriptor(Intl.NumberFormat.prototype,
Symbol.toStringTag);
assertEquals("Object", descriptor.value);
assertEquals("Intl.NumberFormat", descriptor.value);
assertFalse(descriptor.writable);
assertFalse(descriptor.enumerable);
assertTrue(descriptor.configurable);
......@@ -23,7 +23,7 @@ assertTrue(descriptor.configurable);
descriptor = Object.getOwnPropertyDescriptor(Intl.Collator.prototype,
Symbol.toStringTag);
assertEquals("Object", descriptor.value);
assertEquals("Intl.Collator", descriptor.value);
assertFalse(descriptor.writable);
assertFalse(descriptor.enumerable);
assertTrue(descriptor.configurable);
......@@ -552,6 +552,17 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=7472
'intl402/NumberFormat/currency-digits': [FAIL],
# http://crbug/v8/10554
'intl402/Collator/instance-class': [FAIL],
'intl402/Collator/prototype/builtin': [FAIL],
'intl402/DateTimeFormat/prototype/builtin': [FAIL],
'intl402/DateTimeFormat/instance-class': [FAIL],
'intl402/NumberFormat/prototype/builtin': [FAIL],
'intl402/NumberFormat/instance-class': [FAIL],
'intl402/NumberFormat/prototype/toStringTag/configurable': [FAIL],
'intl402/NumberFormat/prototype/toStringTag/prop-desc': [FAIL],
'intl402/PluralRules/prototype/builtins': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=7831
'language/statements/generators/generator-created-after-decl-inst': [FAIL],
'language/expressions/generators/generator-created-after-decl-inst': [FAIL],
......
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