mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-01 20:10:28 +00:00
LibJS: Convert Date::create() to NonnullGCPtr
This commit is contained in:
parent
0eeb3164fa
commit
790b21c8b5
Notes:
sideshowbarker
2024-07-17 03:18:19 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/790b21c8b5 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
2 changed files with 3 additions and 4 deletions
|
@ -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> Date::create(Realm& realm, double date_value)
|
||||
{
|
||||
return realm.heap().allocate<Date>(realm, date_value, *realm.intrinsics().date_prototype());
|
||||
return *realm.heap().allocate<Date>(realm, date_value, *realm.intrinsics().date_prototype());
|
||||
}
|
||||
|
||||
Date::Date(double date_value, Object& prototype)
|
||||
|
|
|
@ -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<Date> create(Realm&, double date_value);
|
||||
|
||||
virtual ~Date() override = default;
|
||||
|
||||
|
|
Loading…
Reference in a new issue