mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:47:45 +00:00
LibWeb: Move setting of FormDataPrototype to initialize()
This moves the setting of FormDataPrototype out of the constructor to initialize().
This commit is contained in:
parent
4b1e501bdf
commit
f698585097
2 changed files with 9 additions and 1 deletions
|
@ -42,11 +42,18 @@ FormData::FormData(JS::Realm& realm, HashMap<DeprecatedString, Vector<FormDataEn
|
||||||
: PlatformObject(realm)
|
: PlatformObject(realm)
|
||||||
, m_entry_list(move(entry_list))
|
, m_entry_list(move(entry_list))
|
||||||
{
|
{
|
||||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::FormDataPrototype>(realm, "FormData"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FormData::~FormData() = default;
|
FormData::~FormData() = default;
|
||||||
|
|
||||||
|
JS::ThrowCompletionOr<void> FormData::initialize(JS::Realm& realm)
|
||||||
|
{
|
||||||
|
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||||
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::FormDataPrototype>(realm, "FormData"));
|
||||||
|
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
void FormData::visit_edges(Cell::Visitor& visitor)
|
void FormData::visit_edges(Cell::Visitor& visitor)
|
||||||
{
|
{
|
||||||
Base::visit_edges(visitor);
|
Base::visit_edges(visitor);
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
private:
|
private:
|
||||||
explicit FormData(JS::Realm&, HashMap<DeprecatedString, Vector<FormDataEntryValue>> entry_list = {});
|
explicit FormData(JS::Realm&, HashMap<DeprecatedString, Vector<FormDataEntryValue>> entry_list = {});
|
||||||
|
|
||||||
|
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||||
virtual void visit_edges(Cell::Visitor&) override;
|
virtual void visit_edges(Cell::Visitor&) override;
|
||||||
|
|
||||||
WebIDL::ExceptionOr<void> append_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
WebIDL::ExceptionOr<void> append_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue