diff options
author | Linus Groh <mail@linusgroh.de> | 2021-06-19 23:21:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-20 12:12:39 +0200 |
commit | e5753443ae8331c874c1516807f8a361c628d858 (patch) | |
tree | 142f0d23af42538e57aed28b386bedbde666ca92 /Userland/Libraries/LibJS/Runtime/MapIterator.cpp | |
parent | df095afbcca06d550d2034393f421981b4bf0b47 (diff) | |
download | serenity-e5753443ae8331c874c1516807f8a361c628d858.zip |
LibJS: Consistently make prototype the last argument in Object ctors
This is so that we can reliably allocate them in a template function,
e.g. in ordinary_create_from_constructor():
global_object.heap().allocate<T>(
global_object, forward<Args>(args)..., *prototype);
The majority of objects already take the prototype as the last argument,
so I updated the ones that didn't.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/MapIterator.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/MapIterator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp index e7196183c6..11e9af926f 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIterator.cpp @@ -11,10 +11,10 @@ namespace JS { MapIterator* MapIterator::create(GlobalObject& global_object, Map& map, Object::PropertyKind iteration_kind) { - return global_object.heap().allocate<MapIterator>(global_object, *global_object.map_iterator_prototype(), map, iteration_kind); + return global_object.heap().allocate<MapIterator>(global_object, map, iteration_kind, *global_object.map_iterator_prototype()); } -MapIterator::MapIterator(Object& prototype, Map& map, Object::PropertyKind iteration_kind) +MapIterator::MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype) : Object(prototype) , m_map(map) , m_iteration_kind(iteration_kind) |