From 713d8dc0f884e8e4de4083efe2cc62e3efe7f6e4 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 31 Mar 2024 11:56:13 +0200 Subject: [PATCH] LibJS: Add support for constructing a PropertyKey from a FlyString --- Userland/Libraries/LibJS/Runtime/PropertyKey.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index 24319b65581..dc439a43347 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include #include @@ -71,6 +72,12 @@ public: { } + PropertyKey(FlyString const& string) + : m_type(Type::String) + , m_string(string.to_deprecated_fly_string()) + { + } + PropertyKey(DeprecatedFlyString string, StringMayBeNumber string_may_be_number = StringMayBeNumber::Yes) : m_string_may_be_number(string_may_be_number == StringMayBeNumber::Yes) , m_type(Type::String)