summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/DataView.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-06-19 23:21:08 +0100
committerAndreas Kling <kling@serenityos.org>2021-06-20 12:12:39 +0200
commite5753443ae8331c874c1516807f8a361c628d858 (patch)
tree142f0d23af42538e57aed28b386bedbde666ca92 /Userland/Libraries/LibJS/Runtime/DataView.cpp
parentdf095afbcca06d550d2034393f421981b4bf0b47 (diff)
downloadserenity-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/DataView.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/DataView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/DataView.cpp b/Userland/Libraries/LibJS/Runtime/DataView.cpp
index 836f8ccf26..ce6856da4c 100644
--- a/Userland/Libraries/LibJS/Runtime/DataView.cpp
+++ b/Userland/Libraries/LibJS/Runtime/DataView.cpp
@@ -10,10 +10,10 @@ namespace JS {
DataView* DataView::create(GlobalObject& global_object, ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset)
{
- return global_object.heap().allocate<DataView>(global_object, *global_object.data_view_prototype(), viewed_buffer, byte_length, byte_offset);
+ return global_object.heap().allocate<DataView>(global_object, viewed_buffer, byte_length, byte_offset, *global_object.data_view_prototype());
}
-DataView::DataView(Object& prototype, ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset)
+DataView::DataView(ArrayBuffer* viewed_buffer, size_t byte_length, size_t byte_offset, Object& prototype)
: Object(prototype)
, m_viewed_array_buffer(viewed_buffer)
, m_byte_length(byte_length)