mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
LibJS: Convert the GetValue AO to ThrowCompletionOr
This commit is contained in:
parent
d73b258874
commit
390a04a985
Notes:
sideshowbarker
2024-07-18 01:33:41 +09:00
Author: https://github.com/IdanHo
Commit: 390a04a985
Pull-request: https://github.com/SerenityOS/serenity/pull/10765
Reviewed-by: https://github.com/linusg ✅
6 changed files with 33 additions and 49 deletions
|
@ -65,9 +65,7 @@ TESTJS_GLOBAL_FUNCTION(mark_as_garbage, markAsGarbage)
|
|||
|
||||
auto reference = vm.resolve_binding(variable_name.string(), outer_environment.value()->lexical_environment);
|
||||
|
||||
auto value = reference.get_value(global_object);
|
||||
if (auto* exception = vm.exception())
|
||||
return JS::throw_completion(exception->value());
|
||||
auto value = TRY(reference.get_value(global_object));
|
||||
|
||||
if (!value.is_object())
|
||||
return vm.throw_completion<JS::TypeError>(global_object, JS::ErrorType::NotAnObject, String::formatted("Variable with name {}", variable_name.string()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue