mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 04:07:35 +00:00
LibJS: Handle both const and non-const Ts in Handle<T>::create()
Again, the const-ness only really involves Heap-internal metadata, so the callers shouldn't care about mutations here.
This commit is contained in:
parent
74e93a46ea
commit
70a2ca7fc0
6 changed files with 10 additions and 10 deletions
|
@ -52,11 +52,11 @@ void PendingResponse::resolve(JS::NonnullGCPtr<Infrastructure::Response> 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<PendingResponse&>(*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());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue