diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PrimitiveString.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PrimitiveString.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h index b9e24d7c5f..743ab79649 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h @@ -7,6 +7,7 @@ #pragma once #include <AK/String.h> +#include <AK/Vector.h> #include <LibJS/Heap/Cell.h> namespace JS { @@ -16,14 +17,21 @@ public: explicit PrimitiveString(String); virtual ~PrimitiveString(); - const String& string() const { return m_string; } + String const& string() const { return m_string; } + + Vector<u16> const& utf16_string() const; + Utf16View utf16_string_view() const; private: virtual const char* class_name() const override { return "PrimitiveString"; } String m_string; + mutable Vector<u16> m_utf16_string; }; +PrimitiveString* js_string(Heap&, Utf16View const&); +PrimitiveString* js_string(VM&, Utf16View const&); + PrimitiveString* js_string(Heap&, String); PrimitiveString* js_string(VM&, String); |