summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibJS/Runtime/Value.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h
index aadf403302..b02f05b8f3 100644
--- a/Userland/Libraries/LibJS/Runtime/Value.h
+++ b/Userland/Libraries/LibJS/Runtime/Value.h
@@ -18,6 +18,7 @@
#include <AK/String.h>
#include <AK/Types.h>
#include <LibJS/Forward.h>
+#include <LibJS/Heap/GCPtr.h>
#include <LibJS/Runtime/BigInt.h>
#include <LibJS/Runtime/Utf16String.h>
#include <math.h>
@@ -275,6 +276,18 @@ public:
{
}
+ template<typename T>
+ Value(GCPtr<T> ptr)
+ : Value(ptr.ptr())
+ {
+ }
+
+ template<typename T>
+ Value(NonnullGCPtr<T> ptr)
+ : Value(ptr.ptr())
+ {
+ }
+
double as_double() const
{
VERIFY(is_number());