mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +00:00
LibJS: Explicitly indicate infallible incovations
These are editorial changes in the Intl spec. See:6804096
6361167
8718171
fd37cb4
00fcfb0
913f832
This commit is contained in:
parent
278241859b
commit
7c41e6058a
11 changed files with 37 additions and 37 deletions
|
@ -48,7 +48,7 @@ static ThrowCompletionOr<String> apply_options_to_tag(GlobalObject& global_objec
|
|||
// 1. Assert: Type(tag) is String.
|
||||
// 2. Assert: Type(options) is Object.
|
||||
|
||||
// 3. If IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.
|
||||
// 3. If ! IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception.
|
||||
auto locale_id = is_structurally_valid_language_tag(tag);
|
||||
if (!locale_id.has_value())
|
||||
return vm.throw_completion<RangeError>(global_object, ErrorType::IntlInvalidLanguageTag, tag);
|
||||
|
@ -68,7 +68,7 @@ static ThrowCompletionOr<String> apply_options_to_tag(GlobalObject& global_objec
|
|||
// a. If region does not match the unicode_region_subtag production, throw a RangeError exception.
|
||||
auto region = TRY(get_string_option(global_object, options, vm.names.region, Unicode::is_unicode_region_subtag));
|
||||
|
||||
// 10. Set tag to CanonicalizeUnicodeLocaleId(tag).
|
||||
// 10. Set tag to ! CanonicalizeUnicodeLocaleId(tag).
|
||||
auto canonicalized_tag = JS::Intl::canonicalize_unicode_locale_id(*locale_id);
|
||||
|
||||
// 11. Assert: tag matches the unicode_locale_id production.
|
||||
|
@ -103,7 +103,7 @@ static ThrowCompletionOr<String> apply_options_to_tag(GlobalObject& global_objec
|
|||
}
|
||||
|
||||
// 16. Set tag to tag with the substring corresponding to the unicode_language_id production replaced by the string languageId.
|
||||
// 17. Return CanonicalizeUnicodeLocaleId(tag).
|
||||
// 17. Return ! CanonicalizeUnicodeLocaleId(tag).
|
||||
return JS::Intl::canonicalize_unicode_locale_id(*locale_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue