mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibJS: Use a forwarding reference in ThrowCompletion constructor
This avoids compiler complaints when trying to use const types
This commit is contained in:
parent
17a528c49e
commit
d4b08b7196
1 changed files with 1 additions and 1 deletions
|
@ -307,7 +307,7 @@ public:
|
||||||
// Most commonly: Value from Object* or similar, so we can omit the curly braces from "return { TRY(...) };".
|
// 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.
|
// Disabled for POD types to avoid weird conversion shenanigans.
|
||||||
template<typename WrappedValueType>
|
template<typename WrappedValueType>
|
||||||
ThrowCompletionOr(WrappedValueType const& value)
|
ThrowCompletionOr(WrappedValueType&& value)
|
||||||
requires(!IsPOD<ValueType>)
|
requires(!IsPOD<ValueType>)
|
||||||
: m_value_or_throw_completion(ValueType { value })
|
: m_value_or_throw_completion(ValueType { value })
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue