mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Convert Intl::Segments::create() to NonnullGCPtr
This commit is contained in:
parent
df589bb05b
commit
237402aea9
Notes:
sideshowbarker
2024-07-17 17:49:11 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/237402aea9 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
2 changed files with 3 additions and 3 deletions
|
@ -11,14 +11,14 @@
|
|||
namespace JS::Intl {
|
||||
|
||||
// 18.5.1 CreateSegmentsObject ( segmenter, string ), https://tc39.es/ecma402/#sec-createsegmentsobject
|
||||
Segments* Segments::create(Realm& realm, Segmenter& segmenter, Utf16String string)
|
||||
NonnullGCPtr<Segments> Segments::create(Realm& realm, Segmenter& segmenter, Utf16String string)
|
||||
{
|
||||
// 1. Let internalSlotsList be « [[SegmentsSegmenter]], [[SegmentsString]] ».
|
||||
// 2. Let segments be OrdinaryObjectCreate(%SegmentsPrototype%, internalSlotsList).
|
||||
// 3. Set segments.[[SegmentsSegmenter]] to segmenter.
|
||||
// 4. Set segments.[[SegmentsString]] to string.
|
||||
// 5. Return segments.
|
||||
return realm.heap().allocate<Segments>(realm, realm, segmenter, move(string));
|
||||
return *realm.heap().allocate<Segments>(realm, realm, segmenter, move(string));
|
||||
}
|
||||
|
||||
// 18.5 Segments Objects, https://tc39.es/ecma402/#sec-segments-objects
|
||||
|
|
|
@ -16,7 +16,7 @@ class Segments final : public Object {
|
|||
JS_OBJECT(Segments, Object);
|
||||
|
||||
public:
|
||||
static Segments* create(Realm&, Segmenter&, Utf16String);
|
||||
static NonnullGCPtr<Segments> create(Realm&, Segmenter&, Utf16String);
|
||||
|
||||
virtual ~Segments() override = default;
|
||||
|
||||
|
|
Loading…
Reference in a new issue