1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:17:44 +00:00

LibJS: Convert WeakRef::create() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-13 20:49:50 +00:00
parent 3358ddfd0e
commit cac71a6847
2 changed files with 6 additions and 6 deletions

View file

@ -8,14 +8,14 @@
namespace JS {
WeakRef* WeakRef::create(Realm& realm, Object& value)
NonnullGCPtr<WeakRef> WeakRef::create(Realm& realm, Object& value)
{
return realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype());
return *realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype());
}
WeakRef* WeakRef::create(Realm& realm, Symbol& value)
NonnullGCPtr<WeakRef> WeakRef::create(Realm& realm, Symbol& value)
{
return realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype());
return *realm.heap().allocate<WeakRef>(realm, value, *realm.intrinsics().weak_ref_prototype());
}
WeakRef::WeakRef(Object& value, Object& prototype)

View file

@ -18,8 +18,8 @@ class WeakRef final
JS_OBJECT(WeakRef, Object);
public:
static WeakRef* create(Realm&, Object&);
static WeakRef* create(Realm&, Symbol&);
static NonnullGCPtr<WeakRef> create(Realm&, Object&);
static NonnullGCPtr<WeakRef> create(Realm&, Symbol&);
virtual ~WeakRef() override = default;