mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Convert Object::get() to ThrowCompletionOr
To no one's surprise, this patch is pretty big - this is possibly the most used AO of all of them. Definitely worth it though.
This commit is contained in:
parent
9b6c09e2c4
commit
b7e5f08e56
Notes:
sideshowbarker
2024-07-18 03:07:41 +09:00
Author: https://github.com/linusg
Commit: b7e5f08e56
Pull-request: https://github.com/SerenityOS/serenity/pull/10327
Reviewed-by: https://github.com/IdanHo ✅
61 changed files with 326 additions and 686 deletions
|
@ -78,11 +78,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw)
|
|||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
auto raw_value = cooked->get(vm.names.raw);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
auto* raw = raw_value.to_object(global_object);
|
||||
auto* raw = TRY_OR_DISCARD(cooked->get(vm.names.raw)).to_object(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
|
@ -98,10 +94,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw)
|
|||
StringBuilder builder;
|
||||
for (size_t i = 0; i < literal_segments; ++i) {
|
||||
auto next_key = String::number(i);
|
||||
auto next_segment_value = raw->get(next_key);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto next_segment = next_segment_value.to_string(global_object);
|
||||
auto next_segment = TRY_OR_DISCARD(raw->get(next_key)).to_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue