mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibJS: Convert Map::create() to NonnullGCPtr
This commit is contained in:
parent
45f903da00
commit
d48cdc7fa6
Notes:
sideshowbarker
2024-07-17 03:17:37 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/d48cdc7fa6 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
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…
Reference in a new issue