1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 23:48:11 +00:00

LibWeb: Port DOMException interface from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-09-06 16:03:01 +12:00 committed by Tim Flynn
parent bcb6851c07
commit 41928c2902
65 changed files with 296 additions and 296 deletions

View file

@ -42,7 +42,7 @@ JS::NonnullGCPtr<JS::Promise> SubtleCrypto::digest(String const& algorithm, JS::
// 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 = WebIDL::get_buffer_source_copy(*data.cell());
if (data_buffer_or_error.is_error()) {
auto error = WebIDL::OperationError::create(realm, "Failed to copy bytes from ArrayBuffer");
auto error = WebIDL::OperationError::create(realm, "Failed to copy bytes from ArrayBuffer"_fly_string);
auto promise = JS::Promise::create(realm);
promise->reject(error.ptr());
return promise;
@ -64,7 +64,7 @@ JS::NonnullGCPtr<JS::Promise> SubtleCrypto::digest(String const& algorithm, JS::
}
// 4. If an error occurred, return a Promise rejected with normalizedAlgorithm.
else {
auto error = WebIDL::NotSupportedError::create(realm, DeprecatedString::formatted("Invalid hash function '{}'", algorithm));
auto error = WebIDL::NotSupportedError::create(realm, MUST(String::formatted("Invalid hash function '{}'", algorithm)));
auto promise = JS::Promise::create(realm);
promise->reject(error.ptr());
return promise;
@ -85,7 +85,7 @@ JS::NonnullGCPtr<JS::Promise> SubtleCrypto::digest(String const& algorithm, JS::
auto digest = hash.digest();
auto result_buffer = ByteBuffer::copy(digest.immutable_data(), hash.digest_size());
if (result_buffer.is_error()) {
auto error = WebIDL::OperationError::create(realm, "Failed to create result buffer");
auto error = WebIDL::OperationError::create(realm, "Failed to create result buffer"_fly_string);
promise->reject(error.ptr());
return promise;
}