1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

LibJS: Convert Object::set() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 00:32:43 +01:00
parent b7e5f08e56
commit 1d45541278
18 changed files with 89 additions and 188 deletions

View file

@ -249,7 +249,7 @@ void GetById::execute_impl(Bytecode::Interpreter& interpreter) const
void PutById::execute_impl(Bytecode::Interpreter& interpreter) const
{
if (auto* object = interpreter.reg(m_base).to_object(interpreter.global_object()))
object->set(interpreter.current_executable().get_string(m_property), interpreter.accumulator(), Object::ShouldThrowExceptions::Yes);
MUST(object->set(interpreter.current_executable().get_string(m_property), interpreter.accumulator(), Object::ShouldThrowExceptions::Yes));
}
void Jump::execute_impl(Bytecode::Interpreter& interpreter) const
@ -447,7 +447,7 @@ void PutByValue::execute_impl(Bytecode::Interpreter& interpreter) const
auto property_key = interpreter.reg(m_property).to_property_key(interpreter.global_object());
if (interpreter.vm().exception())
return;
object->set(property_key, interpreter.accumulator(), Object::ShouldThrowExceptions::Yes);
MUST(object->set(property_key, interpreter.accumulator(), Object::ShouldThrowExceptions::Yes));
}
}