diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp index bcad3cf09d..575339a254 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp @@ -7,7 +7,6 @@ #include <LibCrypto/Hash/HashManager.h> #include <LibJS/Runtime/ArrayBuffer.h> #include <LibJS/Runtime/Promise.h> -#include <LibWeb/Bindings/DOMExceptionWrapper.h> #include <LibWeb/Bindings/IDLAbstractOperations.h> #include <LibWeb/Bindings/MainThreadVM.h> #include <LibWeb/Crypto/SubtleCrypto.h> @@ -38,7 +37,7 @@ JS::Promise* SubtleCrypto::digest(String const& algorithm, JS::Handle<JS::Object // 2. Let data be the result of getting a copy of the bytes held by the data parameter passed to the digest() method. auto data_buffer_or_error = Bindings::IDL::get_buffer_source_copy(*data.cell()); if (data_buffer_or_error.is_error()) { - auto* error = wrap(realm, DOM::OperationError::create("Failed to copy bytes from ArrayBuffer")); + auto* error = wrap(realm, DOM::OperationError::create(global_object(), "Failed to copy bytes from ArrayBuffer")); auto* promise = JS::Promise::create(realm); promise->reject(error); return promise; @@ -59,7 +58,7 @@ JS::Promise* SubtleCrypto::digest(String const& algorithm, JS::Handle<JS::Object } // 4. If an error occurred, return a Promise rejected with normalizedAlgorithm. else { - auto* error = wrap(realm, DOM::NotSupportedError::create(String::formatted("Invalid hash function '{}'", algorithm))); + auto* error = wrap(realm, DOM::NotSupportedError::create(global_object(), String::formatted("Invalid hash function '{}'", algorithm))); auto* promise = JS::Promise::create(realm); promise->reject(error); return promise; @@ -80,7 +79,7 @@ JS::Promise* SubtleCrypto::digest(String const& algorithm, JS::Handle<JS::Object auto digest = hash.digest(); auto result_buffer = ByteBuffer::copy(digest.immutable_data(), hash.digest_size()); if (result_buffer.is_error()) { - auto* error = wrap(realm, DOM::OperationError::create("Failed to create result buffer")); + auto* error = wrap(realm, DOM::OperationError::create(global_object(), "Failed to create result buffer")); promise->reject(error); return promise; } |