mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:27:43 +00:00
LibJS: Initialize value in ThrowCompletionOr<void> default constructor
Otherwise, TRY() will crash when calling release_value() on the empty m_value Optional.
This commit is contained in:
parent
5f0f0ac413
commit
fea27143e9
1 changed files with 4 additions and 1 deletions
|
@ -97,7 +97,10 @@ private:
|
|||
template<typename ValueType>
|
||||
class [[nodiscard]] ThrowCompletionOr {
|
||||
public:
|
||||
ThrowCompletionOr() requires(IsSame<ValueType, Empty>) = default;
|
||||
ThrowCompletionOr() requires(IsSame<ValueType, Empty>)
|
||||
: m_value(Empty {})
|
||||
{
|
||||
}
|
||||
|
||||
// Not `explicit` on purpose so that `return vm.throw_completion<Error>(...);` is possible.
|
||||
ThrowCompletionOr(Completion throw_completion)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue