mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:07:45 +00:00
LibJS: Do not refer to moved-from completions / values
In the ThrowCompletionOr constructors, the VERIFY statements are using moved-from objects. We should not rely on those objects still being valid after being moved.
This commit is contained in:
parent
821ae3a479
commit
a78058bc79
1 changed files with 2 additions and 2 deletions
|
@ -101,7 +101,7 @@ public:
|
||||||
ThrowCompletionOr(Completion throw_completion)
|
ThrowCompletionOr(Completion throw_completion)
|
||||||
: m_throw_completion(move(throw_completion))
|
: m_throw_completion(move(throw_completion))
|
||||||
{
|
{
|
||||||
VERIFY(throw_completion.is_error());
|
VERIFY(m_throw_completion->is_error());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Not `explicit` on purpose so that `return value;` is possible.
|
// Not `explicit` on purpose so that `return value;` is possible.
|
||||||
|
@ -109,7 +109,7 @@ public:
|
||||||
: m_value(move(value))
|
: m_value(move(value))
|
||||||
{
|
{
|
||||||
if constexpr (IsSame<ValueType, Value>)
|
if constexpr (IsSame<ValueType, Value>)
|
||||||
VERIFY(!value.is_empty());
|
VERIFY(!m_value->is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allows implicit construction of ThrowCompletionOr<T> from a type U if T(U) is a supported constructor.
|
// Allows implicit construction of ThrowCompletionOr<T> from a type U if T(U) is a supported constructor.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue