diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index cfcf70e9bc..6eacb467e2 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -46,7 +46,7 @@ public: static Handle create(T* cell) { - return Handle(adopt_ref(*new HandleImpl(cell))); + return Handle(adopt_ref(*new HandleImpl(const_cast*>(cell)))); } Handle(T* cell) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 8db5a31feb..9ec12f1951 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -2121,7 +2121,7 @@ Vector> Document::list_of_descendant_browsing_ // of this document's browsing context. if (browsing_context()) { browsing_context()->for_each_in_subtree([&](auto& context) { - list.append(JS::make_handle(const_cast(context))); + list.append(JS::make_handle(context)); return IterationDecision::Continue; }); } diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp index b30960cf30..ac6a064a73 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/Fetching.cpp @@ -838,7 +838,7 @@ WebIDL::ExceptionOr> http_fetch(JS::Realm& rea // NOTE: Step 2 is performed in pending_preflight_response's load callback below. } - auto fetch_main_content = [request = JS::make_handle(request), realm = JS::make_handle(realm), fetch_params = JS::make_handle(const_cast(fetch_params))]() -> WebIDL::ExceptionOr> { + auto fetch_main_content = [request = JS::make_handle(request), realm = JS::make_handle(realm), fetch_params = JS::make_handle(fetch_params)]() -> WebIDL::ExceptionOr> { // 2. If request’s redirect mode is "follow", then set request’s service-workers mode to "none". // NOTE: Redirects coming from the network (as opposed to from a service worker) are not to be exposed to a // service worker. diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.cpp b/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.cpp index 74f4411b85..97eb40bc23 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.cpp @@ -52,11 +52,11 @@ void PendingResponse::resolve(JS::NonnullGCPtr respons run_callback(); } -void PendingResponse::run_callback() const +void PendingResponse::run_callback() { VERIFY(m_callback); VERIFY(m_response); - Platform::EventLoopPlugin::the().deferred_invoke([strong_this = JS::make_handle(const_cast(*this))] { + Platform::EventLoopPlugin::the().deferred_invoke([strong_this = JS::make_handle(*this)] { strong_this->m_callback(*strong_this->m_response); strong_this->m_request->remove_pending_response({}, *strong_this.ptr()); }); diff --git a/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.h b/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.h index f60d0eeacd..3d07e02e05 100644 --- a/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.h +++ b/Userland/Libraries/LibWeb/Fetch/Fetching/PendingResponse.h @@ -35,7 +35,7 @@ private: virtual void visit_edges(JS::Cell::Visitor&) override; - void run_callback() const; + void run_callback(); Callback m_callback; JS::NonnullGCPtr m_request; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index 0e87831a55..78c4301efc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -84,13 +84,13 @@ Vector> HTMLSelectElement::list_of_options() const // and all the option element children of all the optgroup element children of the select element, in tree order. Vector> list; - for_each_child_of_type([&](HTMLOptionElement const& option_element) { - list.append(JS::make_handle(const_cast(option_element))); + for_each_child_of_type([&](HTMLOptionElement& option_element) { + list.append(JS::make_handle(option_element)); }); for_each_child_of_type([&](HTMLOptGroupElement const& optgroup_element) { - optgroup_element.for_each_child_of_type([&](HTMLOptionElement const& option_element) { - list.append(JS::make_handle(const_cast(option_element))); + optgroup_element.for_each_child_of_type([&](HTMLOptionElement& option_element) { + list.append(JS::make_handle(option_element)); }); });