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/Encoding | |
parent | 2a66fc6cae8ef09e780cd795bf0b1d7f8844f4ec (diff) | |
download | serenity-22089436edec780e03960ecaa74bfc4930126534.zip |
LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibWeb/Encoding')
-rw-r--r-- | Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp index 43c2e21642..bbcb29d462 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -18,7 +18,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(J if (!decoder) return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, DeprecatedString::formatted("Invalid encoding {}", encoding) }; - return JS::NonnullGCPtr(*realm.heap().allocate<TextDecoder>(realm, realm, *decoder, move(encoding), false, false)); + return realm.heap().allocate<TextDecoder>(realm, realm, *decoder, move(encoding), false, false); } // https://encoding.spec.whatwg.org/#dom-textdecoder diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp index 3624e03c28..f5128b6520 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp @@ -13,7 +13,7 @@ namespace Web::Encoding { JS::NonnullGCPtr<TextEncoder> TextEncoder::construct_impl(JS::Realm& realm) { - return *realm.heap().allocate<TextEncoder>(realm, realm); + return realm.heap().allocate<TextEncoder>(realm, realm); } TextEncoder::TextEncoder(JS::Realm& realm) |