summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-07-22 10:19:27 -0400
committerLinus Groh <mail@linusgroh.de>2021-07-23 23:06:57 +0100
commit2c023157e94f6ef8374ae9245eb3a8f85779c294 (patch)
tree2e088aed839786e2dd7c0c59b0b529ca29e8462f /Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h
parentb1ea9c20b0c71e3d44fde28d8a2949ba9640517e (diff)
downloadserenity-2c023157e94f6ef8374ae9245eb3a8f85779c294.zip
LibJS: Implement RegExp.prototype [ @@match ] with UTF-16 code units
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h
index fec3bd44e3..849d3a0669 100644
--- a/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h
+++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIterator.h
@@ -6,6 +6,7 @@
#pragma once
+#include <AK/Utf16View.h>
#include <LibJS/Runtime/Object.h>
namespace JS {
@@ -14,13 +15,13 @@ class RegExpStringIterator final : public Object {
JS_OBJECT(RegExpStringIterator, Object);
public:
- static RegExpStringIterator* create(GlobalObject&, Object& regexp_object, String string, bool global, bool unicode);
+ static RegExpStringIterator* create(GlobalObject&, Object& regexp_object, Vector<u16> string, bool global, bool unicode);
- explicit RegExpStringIterator(Object& prototype, Object& regexp_object, String string, bool global, bool unicode);
+ explicit RegExpStringIterator(Object& prototype, Object& regexp_object, Vector<u16> string, bool global, bool unicode);
virtual ~RegExpStringIterator() override = default;
Object& regexp_object() { return m_regexp_object; }
- String const& string() const { return m_string; }
+ Utf16View string() const { return Utf16View { m_string }; }
bool global() const { return m_global; }
bool unicode() const { return m_unicode; }
@@ -31,7 +32,7 @@ private:
virtual void visit_edges(Cell::Visitor&) override;
Object& m_regexp_object;
- String m_string;
+ Vector<u16> m_string;
bool m_global { false };
bool m_unicode { false };
bool m_done { false };