diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-14 17:40:33 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-12-15 06:56:37 -0500 |
commit | 22089436edec780e03960ecaa74bfc4930126534 (patch) | |
tree | f60662c28d36e8fcce4b734e09af396c68ed1aaf /Userland/Libraries/LibWeb/Bindings | |
parent | 2a66fc6cae8ef09e780cd795bf0b1d7f8844f4ec (diff) | |
download | serenity-22089436edec780e03960ecaa74bfc4930126534.zip |
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings')
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/Intrinsics.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/Intrinsics.h b/Userland/Libraries/LibWeb/Bindings/Intrinsics.h index e1f23779d2..610100c185 100644 --- a/Userland/Libraries/LibWeb/Bindings/Intrinsics.h +++ b/Userland/Libraries/LibWeb/Bindings/Intrinsics.h @@ -34,9 +34,9 @@ public: if (it != m_prototypes.end()) return *it->value; auto& realm = *m_realm; - auto* prototype = heap().allocate<T>(realm, realm); + auto prototype = heap().allocate<T>(realm, realm); m_prototypes.set(class_name, prototype); - return *prototype; + return prototype; } template<typename T> @@ -46,9 +46,9 @@ public: if (it != m_constructors.end()) return *it->value; auto& realm = *m_realm; - auto* constructor = heap().allocate<T>(realm, realm); + auto constructor = heap().allocate<T>(realm, realm); m_constructors.set(class_name, constructor); - return *constructor; + return constructor; } private: diff --git a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp index e719d17b3e..f4aca506d4 100644 --- a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp +++ b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp @@ -375,8 +375,8 @@ JS::VM& main_thread_vm() custom_data.root_execution_context = MUST(JS::Realm::initialize_host_defined_realm(*vm, nullptr, nullptr)); auto* root_realm = custom_data.root_execution_context->realm; - auto* intrinsics = root_realm->heap().allocate<Intrinsics>(*root_realm, *root_realm); - auto host_defined = make<HostDefined>(nullptr, *intrinsics); + auto intrinsics = root_realm->heap().allocate<Intrinsics>(*root_realm, *root_realm); + auto host_defined = make<HostDefined>(nullptr, intrinsics); root_realm->set_host_defined(move(host_defined)); custom_data.internal_realm = root_realm; |