mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs. Work towards #20405
This commit is contained in:
parent
fde26c53f0
commit
18c54d8d40
804 changed files with 1330 additions and 2171 deletions
|
@ -46,12 +46,10 @@ FormData::FormData(JS::Realm& realm, Vector<FormDataEntry> entry_list)
|
|||
|
||||
FormData::~FormData() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> FormData::initialize(JS::Realm& realm)
|
||||
void FormData::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::FormDataPrototype>(realm, "FormData"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://xhr.spec.whatwg.org/#dom-formdata-append
|
||||
|
|
|
@ -51,7 +51,7 @@ private:
|
|||
|
||||
explicit FormData(JS::Realm&, Vector<FormDataEntry> entry_list = {});
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
WebIDL::ExceptionOr<void> append_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
||||
WebIDL::ExceptionOr<void> set_impl(String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
|
||||
|
|
|
@ -37,12 +37,10 @@ FormDataIterator::FormDataIterator(Web::XHR::FormData const& form_data, JS::Obje
|
|||
|
||||
FormDataIterator::~FormDataIterator() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> FormDataIterator::initialize(JS::Realm& realm)
|
||||
void FormDataIterator::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::FormDataIteratorPrototype>(realm, "FormDataIterator"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void FormDataIterator::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
private:
|
||||
FormDataIterator(FormData const&, JS::Object::PropertyKind iterator_kind);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<FormData const> m_form_data;
|
||||
|
|
|
@ -29,12 +29,10 @@ ProgressEvent::ProgressEvent(JS::Realm& realm, FlyString const& event_name, Prog
|
|||
|
||||
ProgressEvent::~ProgressEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> ProgressEvent::initialize(JS::Realm& realm)
|
||||
void ProgressEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ProgressEventPrototype>(realm, "ProgressEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
private:
|
||||
ProgressEvent(JS::Realm&, FlyString const& event_name, ProgressEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
bool m_length_computable { false };
|
||||
u64 m_loaded { 0 };
|
||||
|
|
|
@ -71,12 +71,10 @@ XMLHttpRequest::XMLHttpRequest(JS::Realm& realm, XMLHttpRequestUpload& upload_ob
|
|||
|
||||
XMLHttpRequest::~XMLHttpRequest() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> XMLHttpRequest::initialize(JS::Realm& realm)
|
||||
void XMLHttpRequest::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::XMLHttpRequestPrototype>(realm, "XMLHttpRequest"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void XMLHttpRequest::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
JS::NonnullGCPtr<XMLHttpRequestUpload> upload() const;
|
||||
|
||||
private:
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual bool must_survive_garbage_collection() const override;
|
||||
|
||||
|
|
|
@ -17,12 +17,10 @@ XMLHttpRequestUpload::XMLHttpRequestUpload(JS::Realm& realm)
|
|||
|
||||
XMLHttpRequestUpload::~XMLHttpRequestUpload() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> XMLHttpRequestUpload::initialize(JS::Realm& realm)
|
||||
void XMLHttpRequestUpload::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::XMLHttpRequestUploadPrototype>(realm, "XMLHttpRequestUpload"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
private:
|
||||
XMLHttpRequestUpload(JS::Realm&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue