mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibJS: Fix return type of Object::create_method_property()
This doesn't return a completion in the spec as it doesn't need to propagate any errors. It's also unused right now, which is probably why no one noticed.
This commit is contained in:
parent
b6a69f5f03
commit
be0dcd465f
2 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2020-2023, Linus Groh <linusg@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -139,7 +139,7 @@ ThrowCompletionOr<bool> Object::create_data_property(PropertyKey const& property
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.3.6 CreateMethodProperty ( O, P, V ), https://tc39.es/ecma262/#sec-createmethodproperty
|
// 7.3.6 CreateMethodProperty ( O, P, V ), https://tc39.es/ecma262/#sec-createmethodproperty
|
||||||
ThrowCompletionOr<void> Object::create_method_property(PropertyKey const& property_key, Value value)
|
void Object::create_method_property(PropertyKey const& property_key, Value value)
|
||||||
{
|
{
|
||||||
VERIFY(property_key.is_valid());
|
VERIFY(property_key.is_valid());
|
||||||
VERIFY(!value.is_empty());
|
VERIFY(!value.is_empty());
|
||||||
|
@ -158,7 +158,6 @@ ThrowCompletionOr<void> Object::create_method_property(PropertyKey const& proper
|
||||||
MUST(internal_define_own_property(property_key, new_descriptor));
|
MUST(internal_define_own_property(property_key, new_descriptor));
|
||||||
|
|
||||||
// 4. Return unused.
|
// 4. Return unused.
|
||||||
return {};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 7.3.7 CreateDataPropertyOrThrow ( O, P, V ), https://tc39.es/ecma262/#sec-createdatapropertyorthrow
|
// 7.3.7 CreateDataPropertyOrThrow ( O, P, V ), https://tc39.es/ecma262/#sec-createdatapropertyorthrow
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||||
* Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
|
* Copyright (c) 2020-2023, Linus Groh <linusg@serenityos.org>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +90,7 @@ public:
|
||||||
ThrowCompletionOr<Value> get(PropertyKey const&) const;
|
ThrowCompletionOr<Value> get(PropertyKey const&) const;
|
||||||
ThrowCompletionOr<void> set(PropertyKey const&, Value, ShouldThrowExceptions);
|
ThrowCompletionOr<void> set(PropertyKey const&, Value, ShouldThrowExceptions);
|
||||||
ThrowCompletionOr<bool> create_data_property(PropertyKey const&, Value);
|
ThrowCompletionOr<bool> create_data_property(PropertyKey const&, Value);
|
||||||
ThrowCompletionOr<void> create_method_property(PropertyKey const&, Value);
|
void create_method_property(PropertyKey const&, Value);
|
||||||
ThrowCompletionOr<bool> create_data_property_or_throw(PropertyKey const&, Value);
|
ThrowCompletionOr<bool> create_data_property_or_throw(PropertyKey const&, Value);
|
||||||
void create_non_enumerable_data_property_or_throw(PropertyKey const&, Value);
|
void create_non_enumerable_data_property_or_throw(PropertyKey const&, Value);
|
||||||
ThrowCompletionOr<void> define_property_or_throw(PropertyKey const&, PropertyDescriptor const&);
|
ThrowCompletionOr<void> define_property_or_throw(PropertyKey const&, PropertyDescriptor const&);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue