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

@ -68,7 +68,7 @@ Value ArrayConstructor::construct(FunctionObject& new_target)
MUST(array->create_data_property_or_throw(0, length));
int_length = 1;
} else {
int_length = length.to_u32(global_object());
int_length = MUST(length.to_u32(global_object()));
if (int_length != length.as_double()) {
vm.throw_exception<RangeError>(global_object(), ErrorType::InvalidLength, "array");
return {};