mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibWeb: Move passing of Web object prototypes out of constructors
This commit is contained in:
parent
834202aeb9
commit
af75493883
35 changed files with 157 additions and 23 deletions
|
@ -25,14 +25,14 @@ JS::NonnullGCPtr<Event> Event::construct_impl(JS::Realm& realm, DeprecatedFlyStr
|
|||
}
|
||||
|
||||
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type)
|
||||
: PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
|
||||
: PlatformObject(realm)
|
||||
, m_type(type)
|
||||
, m_initialized(true)
|
||||
{
|
||||
}
|
||||
|
||||
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const& event_init)
|
||||
: PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
|
||||
: PlatformObject(realm)
|
||||
, m_type(type)
|
||||
, m_bubbles(event_init.bubbles)
|
||||
, m_cancelable(event_init.cancelable)
|
||||
|
@ -41,6 +41,12 @@ Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const&
|
|||
{
|
||||
}
|
||||
|
||||
void Event::initialize(JS::Realm& realm)
|
||||
{
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::EventPrototype>(realm, "Event"));
|
||||
}
|
||||
|
||||
void Event::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue