mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 08:17:34 +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
|
@ -22,12 +22,10 @@ FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEvent
|
|||
|
||||
FocusEvent::~FocusEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> FocusEvent::initialize(JS::Realm& realm)
|
||||
void FocusEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::FocusEventPrototype>(realm, "FocusEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
private:
|
||||
FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -570,12 +570,10 @@ KeyboardEvent::KeyboardEvent(JS::Realm& realm, FlyString const& event_name, Keyb
|
|||
|
||||
KeyboardEvent::~KeyboardEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> KeyboardEvent::initialize(JS::Realm& realm)
|
||||
void KeyboardEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::KeyboardEventPrototype>(realm, "KeyboardEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
private:
|
||||
KeyboardEvent(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
String m_key;
|
||||
String m_code;
|
||||
|
|
|
@ -29,12 +29,10 @@ MouseEvent::MouseEvent(JS::Realm& realm, FlyString const& event_name, MouseEvent
|
|||
|
||||
MouseEvent::~MouseEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> MouseEvent::initialize(JS::Realm& realm)
|
||||
void MouseEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MouseEventPrototype>(realm, "MouseEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/uievents/#dom-mouseevent-button
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
protected:
|
||||
MouseEvent(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
void set_event_characteristics();
|
||||
|
|
|
@ -33,12 +33,10 @@ UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name, UIEventInit cons
|
|||
|
||||
UIEvent::~UIEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> UIEvent::initialize(JS::Realm& realm)
|
||||
void UIEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::UIEventPrototype>(realm, "UIEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void UIEvent::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -41,7 +41,7 @@ protected:
|
|||
UIEvent(JS::Realm&, FlyString const& event_name);
|
||||
UIEvent(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::GCPtr<HTML::Window> m_view;
|
||||
|
|
|
@ -23,12 +23,10 @@ WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEvent
|
|||
|
||||
WheelEvent::~WheelEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> WheelEvent::initialize(JS::Realm& realm)
|
||||
void WheelEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::WheelEventPrototype>(realm, "WheelEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<WheelEvent>> WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init)
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
private:
|
||||
WheelEvent(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
void set_event_characteristics();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue