mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
LibJS: Use implicit ThrowCompletionOr<T> constructor where possible
Luckily this is not very widespread yet as most of it would happen in the various JS functions instead of AOs.
This commit is contained in:
parent
894834b5d5
commit
0881f8160f
12 changed files with 25 additions and 25 deletions
|
@ -117,7 +117,7 @@ ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_o
|
|||
// c. Set code to CanonicalizeUnicodeLocaleId(code).
|
||||
// d. Return code.
|
||||
auto canonicalized_tag = JS::Intl::canonicalize_unicode_locale_id(*locale_id);
|
||||
return { js_string(vm, move(canonicalized_tag)) };
|
||||
return js_string(vm, move(canonicalized_tag));
|
||||
}
|
||||
|
||||
// 2. If type is "region", then
|
||||
|
@ -128,7 +128,7 @@ ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_o
|
|||
|
||||
// b. Let code be the result of mapping code to upper case as described in 6.1.
|
||||
// c. Return code.
|
||||
return { js_string(vm, code.to_uppercase_string()) };
|
||||
return js_string(vm, code.to_uppercase_string());
|
||||
}
|
||||
|
||||
// 3. If type is "script", then
|
||||
|
@ -139,7 +139,7 @@ ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_o
|
|||
|
||||
// b. Let code be the result of mapping the first character in code to upper case, and mapping the second, third, and fourth character in code to lower case, as described in 6.1.
|
||||
// c. Return code.
|
||||
return { js_string(vm, code.to_titlecase_string()) };
|
||||
return js_string(vm, code.to_titlecase_string());
|
||||
}
|
||||
|
||||
// 4. Assert: type is "currency".
|
||||
|
@ -151,7 +151,7 @@ ThrowCompletionOr<Value> canonical_code_for_display_names(GlobalObject& global_o
|
|||
|
||||
// 6. Let code be the result of mapping code to upper case as described in 6.1.
|
||||
// 7. Return code.
|
||||
return { js_string(vm, code.to_uppercase_string()) };
|
||||
return js_string(vm, code.to_uppercase_string());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue