From b2034c59dcff65114b8684bf097923c2305992de Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Tue, 13 Dec 2022 20:49:50 +0000 Subject: [PATCH] LibJS: Convert Intl::Locale::create() to NonnullGCPtr --- Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp | 4 ++-- Userland/Libraries/LibJS/Runtime/Intl/Locale.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp index 4ac2d7be5e..4256d0d683 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp @@ -14,9 +14,9 @@ namespace JS::Intl { -Locale* Locale::create(Realm& realm, ::Locale::LocaleID const& locale_id) +NonnullGCPtr Locale::create(Realm& realm, ::Locale::LocaleID const& locale_id) { - return realm.heap().allocate(realm, locale_id, *realm.intrinsics().intl_locale_prototype()); + return *realm.heap().allocate(realm, locale_id, *realm.intrinsics().intl_locale_prototype()); } // 14 Locale Objects, https://tc39.es/ecma402/#locale-objects diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Locale.h b/Userland/Libraries/LibJS/Runtime/Intl/Locale.h index 222d74e5a9..1a3bfafe94 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Locale.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/Locale.h @@ -21,7 +21,7 @@ class Locale final : public Object { JS_OBJECT(Locale, Object); public: - static Locale* create(Realm&, ::Locale::LocaleID const&); + static NonnullGCPtr create(Realm&, ::Locale::LocaleID const&); static constexpr auto relevant_extension_keys() {