mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-02 20:42:11 +02:00
LibJS: Convert to_length() to ThrowCompletionOr
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 02:12:15 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/aad12b050bc Pull-request: https://github.com/SerenityOS/serenity/pull/10522 Reviewed-by: https://github.com/linusg ✅
@@ -212,9 +212,8 @@ ThrowCompletionOr<Vector<String>> canonicalize_locale_list(GlobalObject& global_
|
||||
}
|
||||
|
||||
// 5. Let len be ? ToLength(? Get(O, "length")).
|
||||
auto length = TRY(object->get(vm.names.length)).to_length(global_object);
|
||||
if (auto* exception = vm.exception())
|
||||
return throw_completion(exception->value());
|
||||
auto length_value = TRY(object->get(vm.names.length));
|
||||
auto length = TRY(length_value.to_length(global_object));
|
||||
|
||||
// 6. Let k be 0.
|
||||
// 7. Repeat, while k < len,
|
||||
|
||||
Reference in New Issue
Block a user