From aad12b050bc2f34e367ef95ad89728a0bd4f662e Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sun, 17 Oct 2021 23:57:37 +0300 Subject: LibJS: Convert to_length() to ThrowCompletionOr --- Userland/Applications/Spreadsheet/JSIntegration.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'Userland/Applications/Spreadsheet') diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp index 578cb9b8b3..463973d8e9 100644 --- a/Userland/Applications/Spreadsheet/JSIntegration.cpp +++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp @@ -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()); } -- cgit v1.2.3