LibJS: Convert to_u32() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-17 23:43:29 +03:00
commit cc94bba5c0
Notes: sideshowbarker 2024-07-18 02:12:39 +09:00
14 changed files with 32 additions and 69 deletions

View file

@ -176,7 +176,7 @@ static ByteBuffer numeric_to_raw_bytes(GlobalObject& global_object, Value value,
int_value = value.to_i8(global_object);
} else {
if constexpr (sizeof(UnderlyingBufferDataType) == 4)
int_value = value.to_u32(global_object);
int_value = MUST(value.to_u32(global_object));
else if constexpr (sizeof(UnderlyingBufferDataType) == 2)
int_value = value.to_u16(global_object);
else if constexpr (!IsSame<T, ClampedU8>)