Commit dd5ea32a authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Revert "[intl] Port collator#resolvedOptions to C++"

This reverts commit f2c943fa.

Reason for revert: Non-flaky failures here: https://ci.chromium.org/p/v8/builders/luci.v8.ci/V8%20Linux%20-%20nosnap%20-%20debug/20374

Original change's description:
> [intl] Port collator#resolvedOptions to C++
> 
> Bug: v8:5751
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: I236dd3a1b5390911a6c668201aec33e7db1cbd53
> Reviewed-on: https://chromium-review.googlesource.com/1208650
> Commit-Queue: Sathya Gunasekaran <gsathya@chromium.org>
> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#55668}

TBR=yangguo@chromium.org,gsathya@chromium.org,usharma1998@gmail.com

Change-Id: I018815ec7e3e692cc76a25590c2197a6cf37cc37
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:5751
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1208571Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55669}
parent f2c943fa
......@@ -2980,10 +2980,6 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
factory->Object_string(),
static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
SimpleInstallFunction(isolate_, prototype, "resolvedOptions",
Builtins::kCollatorPrototypeResolvedOptions, 0,
false);
SimpleInstallGetter(isolate_, prototype,
factory->InternalizeUtf8String("compare"),
Builtins::kCollatorPrototypeCompare, false);
......
......@@ -1337,7 +1337,6 @@ namespace internal {
CPP(CollatorPrototypeCompare) \
/* ecma402 #sec-intl.collator.supportedlocalesof */ \
CPP(CollatorSupportedLocalesOf) \
CPP(CollatorPrototypeResolvedOptions) \
/* ecma402 #sup-date.prototype.tolocaledatestring */ \
CPP(DatePrototypeToLocaleDateString) \
/* ecma402 #sup-date.prototype.tolocalestring */ \
......
......@@ -1150,13 +1150,6 @@ BUILTIN(CollatorConstructor) {
isolate, collator, locales, options));
}
BUILTIN(CollatorPrototypeResolvedOptions) {
HandleScope scope(isolate);
CHECK_RECEIVER(JSCollator, collator_holder,
"Intl.Collator.prototype.resolvedOptions");
return *JSCollator::ResolvedOptions(isolate, collator_holder);
}
BUILTIN(CollatorSupportedLocalesOf) {
HandleScope scope(isolate);
RETURN_RESULT_OR_FAILURE(isolate,
......
......@@ -486,6 +486,16 @@ DEFINE_METHOD(
}
);
/**
* Collator resolvedOptions method.
*/
DEFINE_METHOD(
GlobalIntlCollator.prototype,
resolvedOptions() {
return %CollatorResolvedOptions(this);
}
);
DEFINE_METHOD(
GlobalIntlPluralRules.prototype,
select(value) {
......
......@@ -236,6 +236,27 @@ RUNTIME_FUNCTION(Runtime_NumberFormatResolvedOptions) {
return *JSNumberFormat::ResolvedOptions(isolate, number_format);
}
RUNTIME_FUNCTION(Runtime_CollatorResolvedOptions) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, collator_obj, 0);
// 3. If pr does not have an [[InitializedCollator]] internal
// slot, throw a TypeError exception.
if (!collator_obj->IsJSCollator()) {
Handle<String> method_str = isolate->factory()->NewStringFromStaticChars(
"Intl.Collator.prototype.resolvedOptions");
THROW_NEW_ERROR_RETURN_FAILURE(
isolate, NewTypeError(MessageTemplate::kIncompatibleMethodReceiver,
method_str, collator_obj));
}
Handle<JSCollator> collator = Handle<JSCollator>::cast(collator_obj);
return *JSCollator::ResolvedOptions(isolate, collator);
}
RUNTIME_FUNCTION(Runtime_ParseExtension) {
Factory* factory = isolate->factory();
HandleScope scope(isolate);
......
......@@ -202,6 +202,7 @@ namespace internal {
#define FOR_EACH_INTRINSIC_INTL(F) \
F(AvailableLocalesOf, 1, 1) \
F(CanonicalizeLanguageTag, 1, 1) \
F(CollatorResolvedOptions, 1, 1) \
F(CreateDateTimeFormat, 3, 1) \
F(DateCacheVersion, 0, 1) \
F(DateTimeFormatResolvedOptions, 1, 1) \
......
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