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

LibJS: Convert internal_get_own_property() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-29 17:53:57 +01:00
parent 73bae7d779
commit 0e69a6e487
19 changed files with 100 additions and 166 deletions

View file

@ -5,6 +5,7 @@
*/
#include <LibJS/Runtime/ArgumentsObject.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/GlobalObject.h>
namespace JS {
@ -102,10 +103,10 @@ bool ArgumentsObject::internal_delete(PropertyName const& property_name)
}
// 10.4.4.1 [[GetOwnProperty]] ( P ), https://tc39.es/ecma262/#sec-arguments-exotic-objects-getownproperty-p
Optional<PropertyDescriptor> ArgumentsObject::internal_get_own_property(PropertyName const& property_name) const
ThrowCompletionOr<Optional<PropertyDescriptor>> ArgumentsObject::internal_get_own_property(PropertyName const& property_name) const
{
// 1. Let desc be OrdinaryGetOwnProperty(args, P).
auto desc = Object::internal_get_own_property(property_name);
auto desc = Object::internal_get_own_property(property_name).release_value();
// 2. If desc is undefined, return desc.
if (!desc.has_value())
return desc;