diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp index 5acd0e6dfd..f2db15fa0a 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Segmenter.cpp @@ -48,6 +48,7 @@ StringView Segmenter::segmenter_granularity_string() const Object* create_segment_data_object(GlobalObject& global_object, Segmenter const& segmenter, Utf16View const& string, double start_index, double end_index) { auto& vm = global_object.vm(); + auto& realm = *global_object.associated_realm(); // 1. Let len be the length of string. auto length = string.length_in_code_units(); @@ -62,7 +63,7 @@ Object* create_segment_data_object(GlobalObject& global_object, Segmenter const& VERIFY(start_index < end_index); // 5. Let result be OrdinaryObjectCreate(%Object.prototype%). - auto* result = Object::create(global_object, global_object.object_prototype()); + auto* result = Object::create(realm, global_object.object_prototype()); // 6. Let segment be the substring of string from startIndex to endIndex. auto segment = string.substring_view(start_index, end_index - start_index); |