diff options
author | Linus Groh <mail@linusgroh.de> | 2021-03-22 22:56:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-23 08:22:39 +0100 |
commit | 40eab55e7d4e757d6b3fcf18d26db8c6c40bbc25 (patch) | |
tree | 27f6a6aea7b494c155dd1064a33054988ff8df2c /Userland/Applications/Spreadsheet | |
parent | a1014d25def3e0eedec45a35218af63d449fa0b6 (diff) | |
download | serenity-40eab55e7d4e757d6b3fcf18d26db8c6c40bbc25.zip |
LibJS: Remove as_size_t()
Just like to_size_t() - which was already removed in f369229 - this is
non-standard, use to_length() instead. One remaining use was removed,
and I'm glad it's gone. :^)
Diffstat (limited to 'Userland/Applications/Spreadsheet')
-rw-r--r-- | Userland/Applications/Spreadsheet/JSIntegration.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Userland/Applications/Spreadsheet/JSIntegration.cpp b/Userland/Applications/Spreadsheet/JSIntegration.cpp index b62c89298e..b62a5985e9 100644 --- a/Userland/Applications/Spreadsheet/JSIntegration.cpp +++ b/Userland/Applications/Spreadsheet/JSIntegration.cpp @@ -449,7 +449,9 @@ JS_DEFINE_NATIVE_FUNCTION(WorkbookObject::sheet) return JS::Value(&sheet.global_object()); } } else { - auto index = name_value.as_size_t(); + auto index = name_value.to_length(global_object); + if (vm.exception()) + return {}; if (index < workbook.sheets().size()) return JS::Value(&workbook.sheets()[index].global_object()); } |