From 3de75f6436a1e729691a40c35e8e8a5be5aa2f41 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 13 Jan 2023 15:45:04 -0500 Subject: [PATCH] LibJS: Explicitly disallow references in ThrowCompletionOr This will be disallowed by TRY soon, but the compile error produced by this requirement will pinpoint the errant line more accurately. --- Userland/Libraries/LibJS/Forward.h | 2 ++ Userland/Libraries/LibJS/Runtime/Completion.h | 1 + 2 files changed, 3 insertions(+) diff --git a/Userland/Libraries/LibJS/Forward.h b/Userland/Libraries/LibJS/Forward.h index 78bc0ce054..6e656ccfc4 100644 --- a/Userland/Libraries/LibJS/Forward.h +++ b/Userland/Libraries/LibJS/Forward.h @@ -7,6 +7,7 @@ #pragma once +#include #include #define JS_DECLARE_NATIVE_FUNCTION(name) \ @@ -282,6 +283,7 @@ struct PartialDurationRecord; }; template +requires(!IsLvalueReference) class ThrowCompletionOr; template diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index d1f226e647..0e36f3b8a0 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -246,6 +246,7 @@ private: namespace JS { template +requires(!IsLvalueReference) class [[nodiscard]] ThrowCompletionOr { public: ThrowCompletionOr()