mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:37:35 +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
|
@ -37,12 +37,10 @@ Headers::Headers(JS::Realm& realm, JS::NonnullGCPtr<Infrastructure::HeaderList>
|
|||
|
||||
Headers::~Headers() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> Headers::initialize(JS::Realm& realm)
|
||||
void Headers::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::HeadersPrototype>(realm, "Headers"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Headers::visit_edges(JS::Cell::Visitor& visitor)
|
||||
|
|
|
@ -62,7 +62,7 @@ private:
|
|||
|
||||
Headers(JS::Realm&, JS::NonnullGCPtr<Infrastructure::HeaderList>);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
WebIDL::ExceptionOr<bool> validate(Infrastructure::Header const&) const;
|
||||
|
|
|
@ -37,12 +37,10 @@ HeadersIterator::HeadersIterator(Headers const& headers, JS::Object::PropertyKin
|
|||
|
||||
HeadersIterator::~HeadersIterator() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> HeadersIterator::initialize(JS::Realm& realm)
|
||||
void HeadersIterator::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::HeadersIteratorPrototype>(realm, "HeadersIterator"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void HeadersIterator::visit_edges(JS::Cell::Visitor& visitor)
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
JS::ThrowCompletionOr<JS::Object*> next();
|
||||
|
||||
private:
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
HeadersIterator(Headers const&, JS::Object::PropertyKind iteration_kind);
|
||||
|
|
|
@ -29,12 +29,10 @@ Request::Request(JS::Realm& realm, JS::NonnullGCPtr<Infrastructure::Request> req
|
|||
|
||||
Request::~Request() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> Request::initialize(JS::Realm& realm)
|
||||
void Request::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::RequestPrototype>(realm, "Request"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Request::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
private:
|
||||
Request(JS::Realm&, JS::NonnullGCPtr<Infrastructure::Request>);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// https://fetch.spec.whatwg.org/#concept-request-request
|
||||
|
|
|
@ -26,12 +26,10 @@ Response::Response(JS::Realm& realm, JS::NonnullGCPtr<Infrastructure::Response>
|
|||
|
||||
Response::~Response() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> Response::initialize(JS::Realm& realm)
|
||||
void Response::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ResponsePrototype>(realm, "Response"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Response::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
private:
|
||||
Response(JS::Realm&, JS::NonnullGCPtr<Infrastructure::Response>);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
WebIDL::ExceptionOr<void> initialize_response(ResponseInit const&, Optional<Infrastructure::BodyWithType> const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue