diff --git a/Userland/Libraries/LibJS/Runtime/Date.cpp b/Userland/Libraries/LibJS/Runtime/Date.cpp index 4a0dffedc3..3bd4596e4e 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.cpp +++ b/Userland/Libraries/LibJS/Runtime/Date.cpp @@ -21,9 +21,9 @@ static Crypto::SignedBigInteger const s_one_billion_bigint { 1'000'000'000 }; static Crypto::SignedBigInteger const s_one_million_bigint { 1'000'000 }; static Crypto::SignedBigInteger const s_one_thousand_bigint { 1'000 }; -Date* Date::create(Realm& realm, double date_value) +NonnullGCPtr Date::create(Realm& realm, double date_value) { - return realm.heap().allocate(realm, date_value, *realm.intrinsics().date_prototype()); + return *realm.heap().allocate(realm, date_value, *realm.intrinsics().date_prototype()); } Date::Date(double date_value, Object& prototype) diff --git a/Userland/Libraries/LibJS/Runtime/Date.h b/Userland/Libraries/LibJS/Runtime/Date.h index 9233b33460..2757694c89 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.h +++ b/Userland/Libraries/LibJS/Runtime/Date.h @@ -15,8 +15,7 @@ class Date final : public Object { JS_OBJECT(Date, Object); public: - static Date* create(Realm&, double date_value); - static Date* now(VM&); + static NonnullGCPtr create(Realm&, double date_value); virtual ~Date() override = default;