diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index 88015c463e..5d036c8dfa 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling - * Copyright (c) 2020-2022, Linus Groh + * Copyright (c) 2020-2023, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ @@ -139,7 +139,7 @@ ThrowCompletionOr Object::create_data_property(PropertyKey const& property } // 7.3.6 CreateMethodProperty ( O, P, V ), https://tc39.es/ecma262/#sec-createmethodproperty -ThrowCompletionOr 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(!value.is_empty()); @@ -158,7 +158,6 @@ ThrowCompletionOr Object::create_method_property(PropertyKey const& proper MUST(internal_define_own_property(property_key, new_descriptor)); // 4. Return unused. - return {}; } // 7.3.7 CreateDataPropertyOrThrow ( O, P, V ), https://tc39.es/ecma262/#sec-createdatapropertyorthrow diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 824965ec79..4ae4a7db30 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2020, Andreas Kling - * Copyright (c) 2020-2022, Linus Groh + * Copyright (c) 2020-2023, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ @@ -90,7 +90,7 @@ public: ThrowCompletionOr get(PropertyKey const&) const; ThrowCompletionOr set(PropertyKey const&, Value, ShouldThrowExceptions); ThrowCompletionOr create_data_property(PropertyKey const&, Value); - ThrowCompletionOr create_method_property(PropertyKey const&, Value); + void create_method_property(PropertyKey const&, Value); ThrowCompletionOr create_data_property_or_throw(PropertyKey const&, Value); void create_non_enumerable_data_property_or_throw(PropertyKey const&, Value); ThrowCompletionOr define_property_or_throw(PropertyKey const&, PropertyDescriptor const&);