diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseCapability.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseCapability.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h index c2cee43deb..fac53cadb3 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseCapability.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseCapability.h @@ -53,6 +53,9 @@ private: return (capability)->promise(); \ } \ \ + static_assert(!IsLvalueReference<decltype(_temporary_try_or_reject_result.release_value())>, \ + "Do not return a reference from a fallible expression"); \ + \ /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ _temporary_try_or_reject_result.release_value(); \ }) @@ -76,6 +79,9 @@ private: return Value { (capability)->promise() }; \ } \ \ + static_assert(!IsLvalueReference<decltype(_temporary_try_or_reject_result.release_value())>, \ + "Do not return a reference from a fallible expression"); \ + \ /* 2. Else if value is a Completion Record, set value to value.[[Value]]. */ \ _temporary_try_or_reject_result.release_value(); \ }) |