mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 14:50:18 +00:00
AK: Make String::number() infallible
This API will always succeed in creating a String representing the provided number in base-10.
This commit is contained in:
parent
03569fc509
commit
dd419b5a8d
Notes:
github-actions[bot]
2024-10-14 18:49:07 +00:00
Author: https://github.com/awesomekling
Commit: dd419b5a8d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1796
46 changed files with 77 additions and 81 deletions
|
@ -836,7 +836,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> scheme_fetch(JS::Realm& r
|
|||
auto full_length = blob->size();
|
||||
|
||||
// 6. Let serializedFullLength be fullLength, serialized and isomorphic encoded.
|
||||
auto serialized_full_length = TRY_OR_THROW_OOM(vm, String::number(full_length));
|
||||
auto serialized_full_length = String::number(full_length);
|
||||
|
||||
// 7. Let type be blob’s type.
|
||||
auto const& type = blob->type();
|
||||
|
@ -1627,7 +1627,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
// 8. If contentLength is non-null, then set contentLengthHeaderValue to contentLength, serialized and
|
||||
// isomorphic encoded.
|
||||
if (content_length.has_value())
|
||||
content_length_header_value = MUST(ByteBuffer::copy(TRY_OR_THROW_OOM(vm, String::number(*content_length)).bytes()));
|
||||
content_length_header_value = MUST(ByteBuffer::copy(String::number(*content_length).bytes()));
|
||||
|
||||
// 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`, contentLengthHeaderValue) to
|
||||
// httpRequest’s header list.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue