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() {