summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2023-03-04 22:19:14 +0000
committerLinus Groh <mail@linusgroh.de>2023-03-04 23:27:08 +0000
commit0b8ebfb618dcd751542962bbdca67218d7151e1a (patch)
tree596780716172f52154f758c22170e445249edbd1 /Userland/Libraries
parent7d50be0b09089998717bc24fab9490e47bc83fd4 (diff)
downloadserenity-0b8ebfb618dcd751542962bbdca67218d7151e1a.zip
LibWeb/HTML: Replace ThrowCompletionOr with ExceptionOr in Location
The former should not be used in LibWeb unless required due to overriding a JS::Object virtual method, for example.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/HTML/Location.cpp16
-rw-r--r--Userland/Libraries/LibWeb/HTML/Location.h16
2 files changed, 16 insertions, 16 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/Location.cpp b/Userland/Libraries/LibWeb/HTML/Location.cpp
index ad872645ae..6c6149c2b7 100644
--- a/Userland/Libraries/LibWeb/HTML/Location.cpp
+++ b/Userland/Libraries/LibWeb/HTML/Location.cpp
@@ -81,7 +81,7 @@ WebIDL::ExceptionOr<String> Location::href() const
}
// https://html.spec.whatwg.org/multipage/history.html#the-location-interface:dom-location-href-2
-JS::ThrowCompletionOr<void> Location::set_href(String const& new_href)
+WebIDL::ExceptionOr<void> Location::set_href(String const& new_href)
{
auto& vm = this->vm();
auto& window = verify_cast<HTML::Window>(HTML::current_global_object());
@@ -121,7 +121,7 @@ WebIDL::ExceptionOr<String> Location::protocol() const
return TRY_OR_THROW_OOM(vm, String::formatted("{}:", url().scheme()));
}
-JS::ThrowCompletionOr<void> Location::set_protocol(String const&)
+WebIDL::ExceptionOr<void> Location::set_protocol(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.protocol setter");
@@ -149,7 +149,7 @@ WebIDL::ExceptionOr<String> Location::host() const
return TRY_OR_THROW_OOM(vm, String::formatted("{}:{}", url.host(), *url.port()));
}
-JS::ThrowCompletionOr<void> Location::set_host(String const&)
+WebIDL::ExceptionOr<void> Location::set_host(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.host setter");
@@ -172,7 +172,7 @@ WebIDL::ExceptionOr<String> Location::hostname() const
return TRY_OR_THROW_OOM(vm, String::from_deprecated_string(url.host()));
}
-JS::ThrowCompletionOr<void> Location::set_hostname(String const&)
+WebIDL::ExceptionOr<void> Location::set_hostname(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.hostname setter");
@@ -195,7 +195,7 @@ WebIDL::ExceptionOr<String> Location::port() const
return TRY_OR_THROW_OOM(vm, String::number(*url.port()));
}
-JS::ThrowCompletionOr<void> Location::set_port(String const&)
+WebIDL::ExceptionOr<void> Location::set_port(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.port setter");
@@ -212,7 +212,7 @@ WebIDL::ExceptionOr<String> Location::pathname() const
return TRY_OR_THROW_OOM(vm, String::from_deprecated_string(url().path()));
}
-JS::ThrowCompletionOr<void> Location::set_pathname(String const&)
+WebIDL::ExceptionOr<void> Location::set_pathname(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.pathname setter");
@@ -235,7 +235,7 @@ WebIDL::ExceptionOr<String> Location::search() const
return TRY_OR_THROW_OOM(vm, String::formatted("?{}", url.query()));
}
-JS::ThrowCompletionOr<void> Location::set_search(String const&)
+WebIDL::ExceptionOr<void> Location::set_search(String const&)
{
auto& vm = this->vm();
return vm.throw_completion<JS::InternalError>(JS::ErrorType::NotImplemented, "Location.search setter");
@@ -259,7 +259,7 @@ WebIDL::ExceptionOr<String> Location::hash() const
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-hash
-JS::ThrowCompletionOr<void> Location::set_hash(String const& value)
+WebIDL::ExceptionOr<void> Location::set_hash(String const& value)
{
// The hash setter steps are:
// 1. If this's relevant Document is null, then return.
diff --git a/Userland/Libraries/LibWeb/HTML/Location.h b/Userland/Libraries/LibWeb/HTML/Location.h
index fc3d8f13e2..9ba033f23a 100644
--- a/Userland/Libraries/LibWeb/HTML/Location.h
+++ b/Userland/Libraries/LibWeb/HTML/Location.h
@@ -23,30 +23,30 @@ public:
virtual ~Location() override;
WebIDL::ExceptionOr<String> href() const;
- JS::ThrowCompletionOr<void> set_href(String const&);
+ WebIDL::ExceptionOr<void> set_href(String const&);
WebIDL::ExceptionOr<String> origin() const;
WebIDL::ExceptionOr<String> protocol() const;
- JS::ThrowCompletionOr<void> set_protocol(String const&);
+ WebIDL::ExceptionOr<void> set_protocol(String const&);
WebIDL::ExceptionOr<String> host() const;
- JS::ThrowCompletionOr<void> set_host(String const&);
+ WebIDL::ExceptionOr<void> set_host(String const&);
WebIDL::ExceptionOr<String> hostname() const;
- JS::ThrowCompletionOr<void> set_hostname(String const&);
+ WebIDL::ExceptionOr<void> set_hostname(String const&);
WebIDL::ExceptionOr<String> port() const;
- JS::ThrowCompletionOr<void> set_port(String const&);
+ WebIDL::ExceptionOr<void> set_port(String const&);
WebIDL::ExceptionOr<String> pathname() const;
- JS::ThrowCompletionOr<void> set_pathname(String const&);
+ WebIDL::ExceptionOr<void> set_pathname(String const&);
WebIDL::ExceptionOr<String> search() const;
- JS::ThrowCompletionOr<void> set_search(String const&);
+ WebIDL::ExceptionOr<void> set_search(String const&);
WebIDL::ExceptionOr<String> hash() const;
- JS::ThrowCompletionOr<void> set_hash(String const&);
+ WebIDL::ExceptionOr<void> set_hash(String const&);
void replace(String const& url) const;
void reload() const;