diff options
18 files changed, 26 insertions, 26 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp index 0215ef042a..c7b98a9680 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.cpp @@ -11,10 +11,10 @@ namespace JS { ArrayIterator* ArrayIterator::create(GlobalObject& global_object, Value array, Object::PropertyKind iteration_kind) { - return global_object.heap().allocate<ArrayIterator>(global_object, *global_object.array_iterator_prototype(), array, iteration_kind); + return global_object.heap().allocate<ArrayIterator>(global_object, array, iteration_kind, *global_object.array_iterator_prototype()); } -ArrayIterator::ArrayIterator(Object& prototype, Value array, Object::PropertyKind iteration_kind) +ArrayIterator::ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype) : Object(prototype) , m_array(array) , m_iteration_kind(iteration_kind) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h index f6216bace8..28089a3be8 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayIterator.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayIterator.h @@ -16,7 +16,7 @@ class ArrayIterator final : public Object { public: static ArrayIterator* create(GlobalObject&, Value array, Object::PropertyKind iteration_kind); - explicit ArrayIterator(Object& prototype, Value array, Object::PropertyKind iteration_kind); + explicit ArrayIterator(Value array, Object::PropertyKind iteration_kind, Object& prototype); virtual ~ArrayIterator() override; Value array() const { return m_array; } diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp index 7483e1d592..f3df564986 100644 --- a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp @@ -10,7 +10,7 @@ namespace JS { BoundFunction::BoundFunction(GlobalObject& global_object, Function& target_function, Value bound_this, Vector<Value> arguments, i32 length, Object* constructor_prototype) - : Function::Function(*global_object.function_prototype(), bound_this, move(arguments)) + : Function::Function(bound_this, move(arguments), *global_object.function_prototype()) , m_target_function(&target_function) , m_constructor_prototype(constructor_prototype) , m_name(String::formatted("bound {}", target_function.name())) 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) diff --git a/Userland/Libraries/LibJS/Runtime/DataView.h b/Userland/Libraries/LibJS/Runtime/DataView.h index b4fc44bb9a..a2032eb29e 100644 --- a/Userland/Libraries/LibJS/Runtime/DataView.h +++ b/Userland/Libraries/LibJS/Runtime/DataView.h @@ -18,7 +18,7 @@ class DataView : public Object { public: static DataView* create(GlobalObject&, ArrayBuffer*, size_t byte_length, size_t byte_offset); - explicit DataView(Object& prototype, ArrayBuffer*, size_t byte_length, size_t byte_offset); + explicit DataView(ArrayBuffer*, size_t byte_length, size_t byte_offset, Object& prototype); virtual ~DataView() override; ArrayBuffer* viewed_array_buffer() const { return m_viewed_array_buffer; } diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp index d64380ba38..12b8e9f61e 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.cpp @@ -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) diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h index 7d7eae3e5d..91b4866c1a 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistry.h @@ -23,7 +23,7 @@ class FinalizationRegistry final public: static FinalizationRegistry* create(GlobalObject&, Function&); - explicit FinalizationRegistry(Object& prototype, Function&); + explicit FinalizationRegistry(Function&, Object& prototype); virtual ~FinalizationRegistry() override; void add_finalization_record(Cell& target, Value held_value, Object* unregister_token); diff --git a/Userland/Libraries/LibJS/Runtime/Function.cpp b/Userland/Libraries/LibJS/Runtime/Function.cpp index debf747aa9..83a37ebfdb 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.cpp +++ b/Userland/Libraries/LibJS/Runtime/Function.cpp @@ -12,11 +12,11 @@ namespace JS { Function::Function(Object& prototype) - : Function(prototype, {}, {}) + : Function({}, {}, prototype) { } -Function::Function(Object& prototype, Value bound_this, Vector<Value> bound_arguments) +Function::Function(Value bound_this, Vector<Value> bound_arguments, Object& prototype) : Object(prototype) , m_bound_this(bound_this) , m_bound_arguments(move(bound_arguments)) diff --git a/Userland/Libraries/LibJS/Runtime/Function.h b/Userland/Libraries/LibJS/Runtime/Function.h index 5658569bb1..41d074eab9 100644 --- a/Userland/Libraries/LibJS/Runtime/Function.h +++ b/Userland/Libraries/LibJS/Runtime/Function.h @@ -46,7 +46,7 @@ protected: virtual void visit_edges(Visitor&) override; explicit Function(Object& prototype); - Function(Object& prototype, Value bound_this, Vector<Value> bound_arguments); + Function(Value bound_this, Vector<Value> bound_arguments, Object& prototype); private: virtual bool is_function() const override { return true; } 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) diff --git a/Userland/Libraries/LibJS/Runtime/MapIterator.h b/Userland/Libraries/LibJS/Runtime/MapIterator.h index c1cb75aa04..52ba4d4c8a 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIterator.h +++ b/Userland/Libraries/LibJS/Runtime/MapIterator.h @@ -18,7 +18,7 @@ class MapIterator final : public Object { public: static MapIterator* create(GlobalObject&, Map& map, Object::PropertyKind iteration_kind); - explicit MapIterator(Object& prototype, Map& map, Object::PropertyKind iteration_kind); + explicit MapIterator(Map& map, Object::PropertyKind iteration_kind, Object& prototype); virtual ~MapIterator() override; Map& map() const { return m_map; } diff --git a/Userland/Libraries/LibJS/Runtime/ScriptFunction.cpp b/Userland/Libraries/LibJS/Runtime/ScriptFunction.cpp index 6bcb0dfe0d..cfa0cdd5f7 100644 --- a/Userland/Libraries/LibJS/Runtime/ScriptFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/ScriptFunction.cpp @@ -50,7 +50,7 @@ ScriptFunction* ScriptFunction::create(GlobalObject& global_object, const FlyStr } ScriptFunction::ScriptFunction(GlobalObject& global_object, const FlyString& name, const Statement& body, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, ScopeObject* parent_scope, Object& prototype, FunctionKind kind, bool is_strict, bool is_arrow_function) - : Function(prototype, is_arrow_function ? vm().this_value(global_object) : Value(), {}) + : Function(is_arrow_function ? vm().this_value(global_object) : Value(), {}, prototype) , m_name(name) , m_body(body) , m_parameters(move(parameters)) diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp index 588e32877c..2ae33407cf 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.cpp @@ -11,10 +11,10 @@ namespace JS { SetIterator* SetIterator::create(GlobalObject& global_object, Set& set, Object::PropertyKind iteration_kind) { - return global_object.heap().allocate<SetIterator>(global_object, *global_object.set_iterator_prototype(), set, iteration_kind); + return global_object.heap().allocate<SetIterator>(global_object, set, iteration_kind, *global_object.set_iterator_prototype()); } -SetIterator::SetIterator(Object& prototype, Set& set, Object::PropertyKind iteration_kind) +SetIterator::SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype) : Object(prototype) , m_set(set) , m_iteration_kind(iteration_kind) diff --git a/Userland/Libraries/LibJS/Runtime/SetIterator.h b/Userland/Libraries/LibJS/Runtime/SetIterator.h index 114316339d..cc85c3d6c5 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIterator.h +++ b/Userland/Libraries/LibJS/Runtime/SetIterator.h @@ -18,7 +18,7 @@ class SetIterator final : public Object { public: static SetIterator* create(GlobalObject&, Set& set, Object::PropertyKind iteration_kind); - explicit SetIterator(Object& prototype, Set& set, Object::PropertyKind iteration_kind); + explicit SetIterator(Set& set, Object::PropertyKind iteration_kind, Object& prototype); virtual ~SetIterator() override; Set& set() const { return m_set; } diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp index 954809872c..b60586e835 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.cpp @@ -12,10 +12,10 @@ namespace JS { StringIterator* StringIterator::create(GlobalObject& global_object, String string) { - return global_object.heap().allocate<StringIterator>(global_object, *global_object.string_iterator_prototype(), move(string)); + return global_object.heap().allocate<StringIterator>(global_object, move(string), *global_object.string_iterator_prototype()); } -StringIterator::StringIterator(Object& prototype, String string) +StringIterator::StringIterator(String string, Object& prototype) : Object(prototype) , m_string(move(string)) , m_iterator(Utf8View(m_string).begin()) diff --git a/Userland/Libraries/LibJS/Runtime/StringIterator.h b/Userland/Libraries/LibJS/Runtime/StringIterator.h index 0321930266..1d47cd0e1b 100644 --- a/Userland/Libraries/LibJS/Runtime/StringIterator.h +++ b/Userland/Libraries/LibJS/Runtime/StringIterator.h @@ -17,7 +17,7 @@ class StringIterator final : public Object { public: static StringIterator* create(GlobalObject&, String string); - explicit StringIterator(Object& prototype, String string); + explicit StringIterator(String string, Object& prototype); virtual ~StringIterator() override; Utf8CodePointIterator& iterator() { return m_iterator; } diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp index 1e71557249..906257550c 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.cpp @@ -10,10 +10,10 @@ namespace JS { WeakRef* WeakRef::create(GlobalObject& global_object, Object* object) { - return global_object.heap().allocate<WeakRef>(global_object, *global_object.weak_ref_prototype(), object); + return global_object.heap().allocate<WeakRef>(global_object, object, *global_object.weak_ref_prototype()); } -WeakRef::WeakRef(Object& prototype, Object* object) +WeakRef::WeakRef(Object* object, Object& prototype) : Object(prototype) , WeakContainer(heap()) , m_value(object) diff --git a/Userland/Libraries/LibJS/Runtime/WeakRef.h b/Userland/Libraries/LibJS/Runtime/WeakRef.h index 43f03e3c2c..cd828c21f7 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRef.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRef.h @@ -20,7 +20,7 @@ class WeakRef final public: static WeakRef* create(GlobalObject&, Object*); - explicit WeakRef(Object& prototype, Object*); + explicit WeakRef(Object*, Object& prototype); virtual ~WeakRef() override; Object* value() const { return m_value; }; |