Skip to content

Commit d4b08b7

Browse files
mattco98linusg
authored andcommitted
LibJS: Use a forwarding reference in ThrowCompletion constructor
This avoids compiler complaints when trying to use const types
1 parent 17a528c commit d4b08b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Userland/Libraries/LibJS/Runtime/Completion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class [[nodiscard]] ThrowCompletionOr {
307307
// Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };".
308308
// Disabled for POD types to avoid weird conversion shenanigans.
309309
template<typename WrappedValueType>
310-
ThrowCompletionOr(WrappedValueType const& value)
310+
ThrowCompletionOr(WrappedValueType&& value)
311311
requires(!IsPOD<ValueType>)
312312
: m_value_or_throw_completion(ValueType { value })
313313
{

0 commit comments

Comments
 (0)