mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:17:35 +00:00
LibJS: Convert WeakRef::create() to NonnullGCPtr
This commit is contained in:
parent
3358ddfd0e
commit
cac71a6847
2 changed files with 6 additions and 6 deletions
|
@ -8,14 +8,14 @@
|
||||||
|
|
||||||
namespace JS {
|
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)
|
WeakRef::WeakRef(Object& value, Object& prototype)
|
||||||
|
|
|
@ -18,8 +18,8 @@ class WeakRef final
|
||||||
JS_OBJECT(WeakRef, Object);
|
JS_OBJECT(WeakRef, Object);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static WeakRef* create(Realm&, Object&);
|
static NonnullGCPtr<WeakRef> create(Realm&, Object&);
|
||||||
static WeakRef* create(Realm&, Symbol&);
|
static NonnullGCPtr<WeakRef> create(Realm&, Symbol&);
|
||||||
|
|
||||||
virtual ~WeakRef() override = default;
|
virtual ~WeakRef() override = default;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue