diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index 8fa7566b61..2d61864e5a 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -277,6 +277,11 @@ public: ThrowCompletionOr(ThrowCompletionOr&&) = default; ThrowCompletionOr& operator=(ThrowCompletionOr&&) = default; + ThrowCompletionOr(OptionalNone value) + : m_value(ValueType { value }) + { + } + // Allows implicit construction of ThrowCompletionOr from a type U if T(U) is a supported constructor. // 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.