mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:07:46 +00:00
LibJS: Convert Intl.Segmenter, Segments and SegmentIterator to Utf16
This is a precursor to implementing the FindBoundary AO, which operates on Utf16 code unit indexes.
This commit is contained in:
parent
4967bcd4ce
commit
b1d19b5917
6 changed files with 17 additions and 16 deletions
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/Utf16View.h>
|
||||
#include <LibJS/Runtime/Intl/Segmenter.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
|
||||
|
@ -16,20 +16,20 @@ class Segments final : public Object {
|
|||
JS_OBJECT(Segments, Object);
|
||||
|
||||
public:
|
||||
static Segments* create(GlobalObject&, Segmenter&, String);
|
||||
static Segments* create(GlobalObject&, Segmenter&, Utf16String);
|
||||
|
||||
Segments(GlobalObject&, Segmenter&, String);
|
||||
Segments(GlobalObject&, Segmenter&, Utf16String);
|
||||
virtual ~Segments() override = default;
|
||||
|
||||
Segmenter& segments_segmenter() const { return m_segments_segmenter; }
|
||||
|
||||
String const& segments_string() const { return m_segments_string; }
|
||||
Utf16View segments_string() const { return m_segments_string.view(); }
|
||||
|
||||
private:
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Segmenter& m_segments_segmenter; // [[SegmentsSegmenter]]
|
||||
String m_segments_string; // [[SegmentsString]]
|
||||
Utf16String m_segments_string; // [[SegmentsString]]
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue