diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index c4b07bd48c..a65651c291 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -272,33 +272,33 @@ template requires(!IsLvalueReference) class [[nodiscard]] ThrowCompletionOr { public: - ThrowCompletionOr() + ALWAYS_INLINE ThrowCompletionOr() requires(IsSame) : m_value_or_throw_completion(Empty {}) { } // Not `explicit` on purpose so that `return vm.throw_completion(...);` is possible. - ThrowCompletionOr(Completion throw_completion) + ALWAYS_INLINE ThrowCompletionOr(Completion throw_completion) : m_value_or_throw_completion(move(throw_completion)) { VERIFY(m_value_or_throw_completion.template get().is_error()); } // Not `explicit` on purpose so that `return value;` is possible. - ThrowCompletionOr(ValueType value) + ALWAYS_INLINE ThrowCompletionOr(ValueType value) : m_value_or_throw_completion(move(value)) { if constexpr (IsSame) VERIFY(!m_value_or_throw_completion.template get().is_empty()); } - ThrowCompletionOr(ThrowCompletionOr const&) = default; - ThrowCompletionOr& operator=(ThrowCompletionOr const&) = default; - ThrowCompletionOr(ThrowCompletionOr&&) = default; - ThrowCompletionOr& operator=(ThrowCompletionOr&&) = default; + ALWAYS_INLINE ThrowCompletionOr(ThrowCompletionOr const&) = default; + ALWAYS_INLINE ThrowCompletionOr& operator=(ThrowCompletionOr const&) = default; + ALWAYS_INLINE ThrowCompletionOr(ThrowCompletionOr&&) = default; + ALWAYS_INLINE ThrowCompletionOr& operator=(ThrowCompletionOr&&) = default; - ThrowCompletionOr(OptionalNone value) + ALWAYS_INLINE ThrowCompletionOr(OptionalNone value) : m_value_or_throw_completion(ValueType { value }) { } @@ -307,7 +307,7 @@ public: // Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };". // Disabled for POD types to avoid weird conversion shenanigans. template - ThrowCompletionOr(WrappedValueType&& value) + ALWAYS_INLINE ThrowCompletionOr(WrappedValueType&& value) requires(!IsPOD) : m_value_or_throw_completion(ValueType { value }) {