mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 10:41:30 +00:00
LibWeb: Make DOMException take error message as a String
There was no need to use FlyString for error messages, and it just caused a bunch of churn since these strings typically only existed during the lifetime of the error.
This commit is contained in:
parent
5f9a36feac
commit
175f3febb8
Notes:
github-actions[bot]
2024-10-12 19:15:13 +00:00
Author: https://github.com/awesomekling
Commit: 175f3febb8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1743
Reviewed-by: https://github.com/ADKaster
89 changed files with 464 additions and 462 deletions
|
@ -48,7 +48,7 @@ WebIDL::ExceptionOr<JS::Handle<WebIDL::ArrayBufferView>> Crypto::get_random_valu
|
|||
{
|
||||
// 1. If array is not an Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array, then throw a TypeMismatchError and terminate the algorithm.
|
||||
if (!array->is_typed_array_base())
|
||||
return WebIDL::TypeMismatchError::create(realm(), "array must be one of Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array"_fly_string);
|
||||
return WebIDL::TypeMismatchError::create(realm(), "array must be one of Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, or BigUint64Array"_string);
|
||||
|
||||
auto const& typed_array = *array->bufferable_object().get<JS::NonnullGCPtr<JS::TypedArrayBase>>();
|
||||
auto typed_array_record = JS::make_typed_array_with_buffer_witness_record(typed_array, JS::ArrayBuffer::Order::SeqCst);
|
||||
|
@ -59,7 +59,7 @@ WebIDL::ExceptionOr<JS::Handle<WebIDL::ArrayBufferView>> Crypto::get_random_valu
|
|||
|
||||
// 2. If the byteLength of array is greater than 65536, throw a QuotaExceededError and terminate the algorithm.
|
||||
if (JS::typed_array_byte_length(typed_array_record) > 65536)
|
||||
return WebIDL::QuotaExceededError::create(realm(), "array's byteLength may not be greater than 65536"_fly_string);
|
||||
return WebIDL::QuotaExceededError::create(realm(), "array's byteLength may not be greater than 65536"_string);
|
||||
|
||||
// FIXME: Handle SharedArrayBuffers
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue