mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 18:20:43 +09:00
LibJS: Convert internal_set() to ThrowCompletionOr
This commit is contained in:
parent
6c2b974db2
commit
e5409c6ead
Notes:
sideshowbarker
2024-07-18 03:19:06 +09:00
Author: https://github.com/linusg
Commit: e5409c6ead
Pull-request: https://github.com/SerenityOS/serenity/pull/10266
Reviewed-by: https://github.com/IdanHo ✅
19 changed files with 66 additions and 69 deletions
|
@ -39,9 +39,10 @@ void Reference::put_value(GlobalObject& global_object, Value value)
|
|||
if (!base_obj)
|
||||
return;
|
||||
|
||||
bool succeeded = base_obj->internal_set(m_name, value, get_this_value());
|
||||
if (vm.exception())
|
||||
auto succeeded_or_error = base_obj->internal_set(m_name, value, get_this_value());
|
||||
if (succeeded_or_error.is_error())
|
||||
return;
|
||||
auto succeeded = succeeded_or_error.release_value();
|
||||
if (!succeeded && m_strict) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::ReferenceNullishSetProperty, m_name, m_base_value.to_string_without_side_effects());
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue