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
commit46acce51423f328c214dc0781fa19bca1911b5f0 (patch)
treecef539858aef2fd4a70c20b4cfa37b6b7648e972
parent83de01043f210530dabbd9e0e92b878af19d757f (diff)
downloadserenity-46acce51423f328c214dc0781fa19bca1911b5f0.zip
LibJS: Convert Intl::CollatorCompareFunction::create() to NonnullGCPtr
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp
index ce9d77b282..7da460de03 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp
@@ -11,9 +11,9 @@
namespace JS::Intl {
-CollatorCompareFunction* CollatorCompareFunction::create(Realm& realm, Collator& collator)
+NonnullGCPtr<CollatorCompareFunction> CollatorCompareFunction::create(Realm& realm, Collator& collator)
{
- return realm.heap().allocate<CollatorCompareFunction>(realm, realm, collator);
+ return *realm.heap().allocate<CollatorCompareFunction>(realm, realm, collator);
}
CollatorCompareFunction::CollatorCompareFunction(Realm& realm, Collator& collator)
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h
index 3bdbc5dd6b..4f56c547c6 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h
+++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.h
@@ -14,7 +14,7 @@ class CollatorCompareFunction : public NativeFunction {
JS_OBJECT(CollatorCompareFunction, NativeFunction);
public:
- static CollatorCompareFunction* create(Realm&, Collator&);
+ static NonnullGCPtr<CollatorCompareFunction> create(Realm&, Collator&);
virtual void initialize(Realm&) override;
virtual ~CollatorCompareFunction() override = default;
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp
index b098839f2a..c46df80645 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorPrototype.cpp
@@ -44,7 +44,7 @@ JS_DEFINE_NATIVE_FUNCTION(CollatorPrototype::compare_getter)
if (!collator->bound_compare()) {
// a. Let F be a new built-in function object as defined in 10.3.3.1.
// b. Set F.[[Collator]] to collator.
- auto* function = CollatorCompareFunction::create(realm, *collator);
+ auto function = CollatorCompareFunction::create(realm, *collator);
// c. Set collator.[[BoundCompare]] to F.
collator->set_bound_compare(function);