mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibJS: Convert to_length() to ThrowCompletionOr
This commit is contained in:
parent
750da61c0f
commit
aad12b050b
8 changed files with 20 additions and 34 deletions
|
@ -425,9 +425,7 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet)
|
|||
return JS::Value(&sheet.global_object());
|
||||
}
|
||||
} else {
|
||||
auto index = name_value.to_length(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto index = TRY_OR_DISCARD(name_value.to_length(global_object));
|
||||
if (index < workbook.sheets().size())
|
||||
return JS::Value(&workbook.sheets()[index].global_object());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue