1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +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

@ -201,8 +201,8 @@ void GlobalEnvironment::create_global_function_binding(FlyString const& name, Va
global_object.define_property_or_throw(name, desc);
if (vm.exception())
return;
global_object.set(name, value, Object::ShouldThrowExceptions::Yes);
if (vm.exception())
auto result_or_error = global_object.set(name, value, Object::ShouldThrowExceptions::Yes);
if (result_or_error.is_error())
return;
if (!m_var_names.contains_slow(name))
m_var_names.append(name);