mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 01:00:05 +00:00
LibJS: Convert set_mutable_binding() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
parent
ae397541fb
commit
7652138ce0
Notes:
sideshowbarker
2024-07-18 02:52:20 +09:00
Author: https://github.com/linusg
Commit: 7652138ce0
Pull-request: https://github.com/SerenityOS/serenity/pull/10413
Reviewed-by: https://github.com/IdanHo ✅
11 changed files with 68 additions and 52 deletions
|
@ -49,10 +49,11 @@ void Reference::put_value(GlobalObject& global_object, Value value)
|
|||
|
||||
VERIFY(m_base_type == BaseType::Environment);
|
||||
VERIFY(m_base_environment);
|
||||
// These can throw, TRY() when converting put_value() to ThrowCompletionOr
|
||||
if (m_environment_coordinate.has_value())
|
||||
static_cast<DeclarativeEnvironment*>(m_base_environment)->set_mutable_binding_direct(global_object, m_environment_coordinate->index, value, m_strict);
|
||||
(void)static_cast<DeclarativeEnvironment*>(m_base_environment)->set_mutable_binding_direct(global_object, m_environment_coordinate->index, value, m_strict);
|
||||
else
|
||||
m_base_environment->set_mutable_binding(global_object, m_name.as_string(), value, m_strict);
|
||||
(void)m_base_environment->set_mutable_binding(global_object, m_name.as_string(), value, m_strict);
|
||||
}
|
||||
|
||||
void Reference::throw_reference_error(GlobalObject& global_object) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue