mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
LibJS: Convert Map::create() to NonnullGCPtr
This commit is contained in:
parent
45f903da00
commit
d48cdc7fa6
3 changed files with 4 additions and 4 deletions
|
@ -863,7 +863,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::group_to_map)
|
|||
}
|
||||
|
||||
// 7. Let map be ! Construct(%Map%).
|
||||
auto* map = Map::create(realm);
|
||||
auto map = Map::create(realm);
|
||||
|
||||
// 8. For each Record { [[Key]], [[Elements]] } g of groups, do
|
||||
for (auto& group : groups) {
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
Map* Map::create(Realm& realm)
|
||||
NonnullGCPtr<Map> Map::create(Realm& realm)
|
||||
{
|
||||
return realm.heap().allocate<Map>(realm, *realm.intrinsics().map_prototype());
|
||||
return *realm.heap().allocate<Map>(realm, *realm.intrinsics().map_prototype());
|
||||
}
|
||||
|
||||
Map::Map(Object& prototype)
|
||||
|
|
|
@ -20,7 +20,7 @@ class Map : public Object {
|
|||
JS_OBJECT(Map, Object);
|
||||
|
||||
public:
|
||||
static Map* create(Realm&);
|
||||
static NonnullGCPtr<Map> create(Realm&);
|
||||
|
||||
virtual ~Map() override = default;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue