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.
This commit is contained in:
Timothy Flynn 2023-01-13 15:45:04 -05:00 committed by Tim Flynn
parent a59ebdac2d
commit 3de75f6436
Notes: sideshowbarker 2024-07-17 03:03:37 +09:00
2 changed files with 3 additions and 0 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <AK/Concepts.h>
#include <AK/Types.h>
#define JS_DECLARE_NATIVE_FUNCTION(name) \
@ -282,6 +283,7 @@ struct PartialDurationRecord;
};
template<typename T>
requires(!IsLvalueReference<T>)
class ThrowCompletionOr;
template<class T>

View file

@ -246,6 +246,7 @@ private:
namespace JS {
template<typename ValueType>
requires(!IsLvalueReference<ValueType>)
class [[nodiscard]] ThrowCompletionOr {
public:
ThrowCompletionOr()