mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
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.
This commit is contained in:
parent
df095afbcc
commit
e5753443ae
Notes:
sideshowbarker
2024-07-18 11:59:27 +09:00
Author: https://github.com/linusg
Commit: e5753443ae
Pull-request: https://github.com/SerenityOS/serenity/pull/8161
Reviewed-by: https://github.com/mattco98
18 changed files with 26 additions and 26 deletions
|
@ -10,10 +10,10 @@ namespace JS {
|
|||
|
||||
FinalizationRegistry* FinalizationRegistry::create(GlobalObject& global_object, Function& cleanup_callback)
|
||||
{
|
||||
return global_object.heap().allocate<FinalizationRegistry>(global_object, *global_object.finalization_registry_prototype(), cleanup_callback);
|
||||
return global_object.heap().allocate<FinalizationRegistry>(global_object, cleanup_callback, *global_object.finalization_registry_prototype());
|
||||
}
|
||||
|
||||
FinalizationRegistry::FinalizationRegistry(Object& prototype, Function& cleanup_callback)
|
||||
FinalizationRegistry::FinalizationRegistry(Function& cleanup_callback, Object& prototype)
|
||||
: Object(prototype)
|
||||
, WeakContainer(heap())
|
||||
, m_cleanup_callback(&cleanup_callback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue