mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 13:49:16 +00:00
LibJS: Convert has_property() to ThrowCompletionOr
This commit is contained in:
parent
a29b7a3ec7
commit
f38a5957bf
Notes:
sideshowbarker
2024-07-18 03:07:10 +09:00
Author: https://github.com/linusg
Commit: f38a5957bf
Pull-request: https://github.com/SerenityOS/serenity/pull/10327
Reviewed-by: https://github.com/IdanHo ✅
11 changed files with 53 additions and 135 deletions
|
@ -242,7 +242,7 @@ ThrowCompletionOr<bool> Object::delete_property_or_throw(PropertyName const& pro
|
|||
}
|
||||
|
||||
// 7.3.11 HasProperty ( O, P ), https://tc39.es/ecma262/#sec-hasproperty
|
||||
bool Object::has_property(PropertyName const& property_name) const
|
||||
ThrowCompletionOr<bool> Object::has_property(PropertyName const& property_name) const
|
||||
{
|
||||
// 1. Assert: Type(O) is Object.
|
||||
|
||||
|
@ -250,7 +250,7 @@ bool Object::has_property(PropertyName const& property_name) const
|
|||
VERIFY(property_name.is_valid());
|
||||
|
||||
// 3. Return ? O.[[HasProperty]](P).
|
||||
return TRY_OR_DISCARD(internal_has_property(property_name));
|
||||
return internal_has_property(property_name);
|
||||
}
|
||||
|
||||
// 7.3.12 HasOwnProperty ( O, P ), https://tc39.es/ecma262/#sec-hasownproperty
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue