[Intl] Fix ListFormat.resolvedOptions order

Fix the broken test of the to-be-landed
test262/intl402/ListFormat/prototype/resolvedOptions/order
The ecma402 spec change from "any order" to "table " order
in https://github.com/tc39/ecma402/pull/279 the intl* proposals
will follow.

Bug: v8:7871
Change-Id: If47ab44791920c23fe2e1101e60205589d0ac093
Reviewed-on: https://chromium-review.googlesource.com/c/1302058
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57191}
This commit is contained in:
Frank Tang 2018-10-31 13:24:09 -07:00 committed by Commit Bot
parent df444cea8c
commit 77d65f9a1f
2 changed files with 12 additions and 3 deletions

View File

@ -219,17 +219,27 @@ MaybeHandle<JSListFormat> JSListFormat::Initialize(
return list_format_holder;
}
// ecma402 #sec-intl.pluralrules.prototype.resolvedoptions
Handle<JSObject> JSListFormat::ResolvedOptions(
Isolate* isolate, Handle<JSListFormat> format_holder) {
Factory* factory = isolate->factory();
// 4. Let options be ! ObjectCreate(%ObjectPrototype%).
Handle<JSObject> result = factory->NewJSObject(isolate->object_function());
// 5. For each row of Table 1, except the header row, do
// Table 1: Resolved Options of ListFormat Instances
// Internal Slot Property
// [[Locale]] "locale"
// [[Type]] "type"
// [[Style]] "style"
Handle<String> locale(format_holder->locale(), isolate);
JSObject::AddProperty(isolate, result, factory->locale_string(), locale,
NONE);
JSObject::AddProperty(isolate, result, factory->style_string(),
format_holder->StyleAsString(), NONE);
JSObject::AddProperty(isolate, result, factory->type_string(),
format_holder->TypeAsString(), NONE);
JSObject::AddProperty(isolate, result, factory->style_string(),
format_holder->StyleAsString(), NONE);
// 6. Return options.
return result;
}

View File

@ -75,7 +75,6 @@
# https://bugs.chromium.org/p/v8/issues/detail?id=8378
'intl402/DateTimeFormat/prototype/resolvedOptions/order': [FAIL],
'intl402/ListFormat/prototype/resolvedOptions/order': [FAIL],
'intl402/NumberFormat/prototype/resolvedOptions/order': [FAIL],
# https://code.google.com/p/v8/issues/detail?id=4251