mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +00:00
LibJS: Reorganize spec steps for Intl.DisplayNames
This is an editorial change in the Intl spec:
5b51804
This commit is contained in:
parent
1f9c5c186f
commit
72462bed2f
3 changed files with 12 additions and 12 deletions
|
@ -100,7 +100,7 @@ StringView DisplayNames::language_display_string() const
|
|||
}
|
||||
}
|
||||
|
||||
// 12.1.1 CanonicalCodeForDisplayNames ( type, code ), https://tc39.es/ecma402/#sec-canonicalcodefordisplaynames
|
||||
// 12.5.1 CanonicalCodeForDisplayNames ( type, code ), https://tc39.es/ecma402/#sec-canonicalcodefordisplaynames
|
||||
ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_object, DisplayNames::Type type, StringView code)
|
||||
{
|
||||
auto& vm = global_object.vm();
|
||||
|
@ -177,10 +177,10 @@ ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_o
|
|||
return js_string(vm, code.to_uppercase_string());
|
||||
}
|
||||
|
||||
// 12.2 IsValidDateTimeFieldCode ( field ), https://tc39.es/ecma402/#sec-isvaliddatetimefieldcode
|
||||
// 12.5.2 IsValidDateTimeFieldCode ( field ), https://tc39.es/ecma402/#sec-isvaliddatetimefieldcode
|
||||
bool is_valid_date_time_field_code(StringView field)
|
||||
{
|
||||
// 1. If field is listed in the Code column of Table 8, return true.
|
||||
// 1. If field is listed in the Code column of Table 9, return true.
|
||||
// 2. Return false.
|
||||
return field.is_one_of("era"sv, "year"sv, "quarter"sv, "month"sv, "weekOfYear"sv, "weekday"sv, "day"sv, "dayPeriod"sv, "hour"sv, "minute"sv, "second"sv, "timeZoneName"sv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue