diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2023-02-12 21:21:12 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-18 00:52:47 +0100 |
commit | 58af8e202169077b9df99fd0fd3bf933fcd79ac1 (patch) | |
tree | dc0f88309dbd89415f64e4e6c4d3b94fd9bd9475 /Userland/Libraries/LibWeb/Crypto | |
parent | fb3294863e360c9aadf4a4e0865806469912abe8 (diff) | |
download | serenity-58af8e202169077b9df99fd0fd3bf933fcd79ac1.zip |
LibWeb: Make factory method of Crypto::Crypto fallible
Diffstat (limited to 'Userland/Libraries/LibWeb/Crypto')
-rw-r--r-- | Userland/Libraries/LibWeb/Crypto/Crypto.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Crypto/Crypto.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp index 04ac2da358..3a02c11aa9 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp @@ -14,9 +14,9 @@ namespace Web::Crypto { -JS::NonnullGCPtr<Crypto> Crypto::create(JS::Realm& realm) +WebIDL::ExceptionOr<JS::NonnullGCPtr<Crypto>> Crypto::create(JS::Realm& realm) { - return realm.heap().allocate<Crypto>(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate<Crypto>(realm, realm)); } Crypto::Crypto(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.h b/Userland/Libraries/LibWeb/Crypto/Crypto.h index 2573bbb344..7811736aaa 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.h +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.h @@ -16,7 +16,7 @@ class Crypto : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(Crypto, Bindings::PlatformObject); public: - static JS::NonnullGCPtr<Crypto> create(JS::Realm&); + static WebIDL::ExceptionOr<JS::NonnullGCPtr<Crypto>> create(JS::Realm&); virtual ~Crypto() override; |