diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-07-09 23:45:01 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-07-09 22:32:25 +0100 |
commit | 56d8098d138463fa9c4e2730337daf7690f9c4d1 (patch) | |
tree | 2bea82529745178194f0809883d649c50605864c /Userland/Libraries/LibJS/Runtime/Object.h | |
parent | fd898be51ad821113f5762a134a568f315588f94 (diff) | |
download | serenity-56d8098d138463fa9c4e2730337daf7690f9c4d1.zip |
LibJS: Use PropertyName instead of StringOrSymbol in Object::invoke()
This prevents the unnecessary PropertyName -> StringOrSymbol ->
PropertyName conversion.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Object.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Object.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 665c6312bf..1bd7428146 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -150,10 +150,10 @@ public: IndexedProperties& indexed_properties() { return m_indexed_properties; } void set_indexed_property_elements(Vector<Value>&& values) { m_indexed_properties = IndexedProperties(move(values)); } - [[nodiscard]] Value invoke_internal(const StringOrSymbol& property_name, Optional<MarkedValueList> arguments); + [[nodiscard]] Value invoke_internal(PropertyName const&, Optional<MarkedValueList> arguments); template<typename... Args> - [[nodiscard]] ALWAYS_INLINE Value invoke(const StringOrSymbol& property_name, Args... args) + [[nodiscard]] ALWAYS_INLINE Value invoke(PropertyName const& property_name, Args... args) { if constexpr (sizeof...(Args) > 0) { MarkedValueList arglist { heap() }; @@ -202,12 +202,12 @@ private: }; template<> -[[nodiscard]] ALWAYS_INLINE Value Object::invoke(const StringOrSymbol& property_name, MarkedValueList arguments) { return invoke_internal(property_name, move(arguments)); } +[[nodiscard]] ALWAYS_INLINE Value Object::invoke(PropertyName const& property_name, MarkedValueList arguments) { return invoke_internal(property_name, move(arguments)); } template<> -[[nodiscard]] ALWAYS_INLINE Value Object::invoke(const StringOrSymbol& property_name, Optional<MarkedValueList> arguments) { return invoke_internal(property_name, move(arguments)); } +[[nodiscard]] ALWAYS_INLINE Value Object::invoke(PropertyName const& property_name, Optional<MarkedValueList> arguments) { return invoke_internal(property_name, move(arguments)); } template<> -[[nodiscard]] ALWAYS_INLINE Value Object::invoke(const StringOrSymbol& property_name) { return invoke(property_name, Optional<MarkedValueList> {}); } +[[nodiscard]] ALWAYS_INLINE Value Object::invoke(PropertyName const& property_name) { return invoke(property_name, Optional<MarkedValueList> {}); } } |