mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 16:21:29 +00:00
LibJS: Convert create_method_property() to ThrowCompletionOr
This commit is contained in:
parent
fb443b3fb4
commit
bb2499cd7a
Notes:
sideshowbarker
2024-07-18 03:07:29 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/bb2499cd7a0 Pull-request: https://github.com/SerenityOS/serenity/pull/10327 Reviewed-by: https://github.com/IdanHo ✅
|
@ -137,7 +137,7 @@ ThrowCompletionOr<bool> Object::create_data_property(PropertyName const& propert
|
|||
}
|
||||
|
||||
// 7.3.6 CreateMethodProperty ( O, P, V ), https://tc39.es/ecma262/#sec-createmethodproperty
|
||||
bool Object::create_method_property(PropertyName const& property_name, Value value)
|
||||
ThrowCompletionOr<bool> Object::create_method_property(PropertyName const& property_name, Value value)
|
||||
{
|
||||
VERIFY(!value.is_empty());
|
||||
|
||||
|
@ -155,7 +155,7 @@ bool Object::create_method_property(PropertyName const& property_name, Value val
|
|||
};
|
||||
|
||||
// 4. Return ? O.[[DefineOwnProperty]](P, newDesc).
|
||||
return TRY_OR_DISCARD(internal_define_own_property(property_name, new_descriptor));
|
||||
return internal_define_own_property(property_name, new_descriptor);
|
||||
}
|
||||
|
||||
// 7.3.7 CreateDataPropertyOrThrow ( O, P, V ), https://tc39.es/ecma262/#sec-createdatapropertyorthrow
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
ThrowCompletionOr<Value> get(PropertyName const&) const;
|
||||
ThrowCompletionOr<bool> set(PropertyName const&, Value, ShouldThrowExceptions);
|
||||
ThrowCompletionOr<bool> create_data_property(PropertyName const&, Value);
|
||||
bool create_method_property(PropertyName const&, Value);
|
||||
ThrowCompletionOr<bool> create_method_property(PropertyName const&, Value);
|
||||
bool create_data_property_or_throw(PropertyName const&, Value);
|
||||
bool create_non_enumerable_data_property_or_throw(PropertyName const&, Value);
|
||||
bool define_property_or_throw(PropertyName const&, PropertyDescriptor const&);
|
||||
|
|
Loading…
Reference in a new issue