mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 01:42:54 +00:00
AK: Make String::number() infallible
This API will always succeed in creating a String representing the provided number in base-10.
This commit is contained in:
parent
03569fc509
commit
dd419b5a8d
Notes:
github-actions[bot]
2024-10-14 18:49:07 +00:00
Author: https://github.com/awesomekling
Commit: dd419b5a8d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1796
46 changed files with 77 additions and 81 deletions
|
@ -251,8 +251,6 @@ WebIDL::ExceptionOr<void> Location::set_hostname(String const&)
|
|||
// https://html.spec.whatwg.org/multipage/history.html#dom-location-port
|
||||
WebIDL::ExceptionOr<String> Location::port() const
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. If this's relevant Document is non-null and its origin is not same origin-domain with the entry settings object's origin, then throw a "SecurityError" DOMException.
|
||||
auto const relevant_document = this->relevant_document();
|
||||
if (relevant_document && !relevant_document->origin().is_same_origin_domain(entry_settings_object().origin()))
|
||||
|
@ -265,7 +263,7 @@ WebIDL::ExceptionOr<String> Location::port() const
|
|||
return String {};
|
||||
|
||||
// 3. Return this's url's port, serialized.
|
||||
return TRY_OR_THROW_OOM(vm, String::number(*url.port()));
|
||||
return String::number(*url.port());
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<void> Location::set_port(String const&)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue