1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:37:34 +00:00

LibJS: Convert ordinary_set_with_own_descriptor() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 19:57:29 +01:00
parent 3b59a4577d
commit 2f42675ebd
3 changed files with 10 additions and 18 deletions

View file

@ -2064,10 +2064,7 @@ JS::ThrowCompletionOr<bool> @class_name@::internal_set(JS::PropertyName const& p
// 3. Perform ? OrdinarySetWithOwnDescriptor(O, P, V, Receiver, ownDesc).
// NOTE: The spec says "perform" instead of "return", meaning nothing will be returned on this path according to the spec, which isn't possible to do.
// Let's treat it as though it says "return" instead of "perform".
auto result = ordinary_set_with_own_descriptor(property_name, value, receiver, own_descriptor);
if (auto* exception = vm.exception())
return JS::throw_completion(exception->value());
return result;
return ordinary_set_with_own_descriptor(property_name, value, receiver, own_descriptor);
}
)~~~");