mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
LibJS: Convert to_u32() to ThrowCompletionOr
This commit is contained in:
parent
f6a5ff7b00
commit
cc94bba5c0
14 changed files with 32 additions and 69 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue