mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02:00
LibJS: Propagate OOM from GetValueFromBuffer AO
This commit is contained in:
committed by
Linus Groh
parent
49c8d22f50
commit
3bb15d3dae
Notes:
sideshowbarker
2024-07-18 03:20:18 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/3bb15d3dae Pull-request: https://github.com/SerenityOS/serenity/pull/19702 Reviewed-by: https://github.com/linusg ✅
@@ -74,7 +74,7 @@ ErrorOr<ByteBuffer> get_buffer_source_copy(JS::Object const& buffer_source)
|
||||
|
||||
// 9. For i in the range offset to offset + length − 1, inclusive, set bytes[i − offset] to ! GetValueFromBuffer(esArrayBuffer, i, Uint8, true, Unordered).
|
||||
for (u64 i = offset; i < offset + length; ++i) {
|
||||
auto value = es_array_buffer->get_value<u8>(i, true, JS::ArrayBuffer::Unordered);
|
||||
auto value = es_array_buffer->get_value<u8>(i, true, JS::ArrayBuffer::Unordered).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
bytes[i - offset] = static_cast<u8>(value.as_double());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user