summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-13 20:49:50 +0000
committerLinus Groh <mail@linusgroh.de>2022-12-14 09:59:45 +0000
commitb2034c59dcff65114b8684bf097923c2305992de (patch)
tree1d9cc3366dd159497d7abfe89fad8d2b45664977
parent81d5bbcb04e9c20d052dc06b8051c828a7250c63 (diff)
downloadserenity-b2034c59dcff65114b8684bf097923c2305992de.zip
LibJS: Convert Intl::Locale::create() to NonnullGCPtr
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/Locale.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/Locale.h2
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> Locale::create(Realm& realm, ::Locale::LocaleID const& locale_id)
{
- return realm.heap().allocate<Locale>(realm, locale_id, *realm.intrinsics().intl_locale_prototype());
+ return *realm.heap().allocate<Locale>(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<Locale> create(Realm&, ::Locale::LocaleID const&);
static constexpr auto relevant_extension_keys()
{