mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-05-24 03:59:09 +00:00
LibWeb: Make CustomElementDefinition relationship with GC more sane
1. Stop using GC::Root in member variables, since that usually creates a realm leak. 2. Stop putting OrderedHashMap<FlyString, GC::Ptr> on the stack while setting these up, since that won't protect the objects from GC.
This commit is contained in:
committed by
Andreas Kling
parent
062e33438e
commit
ceefe7d858
@@ -185,7 +185,7 @@ JS::ThrowCompletionOr<void> CustomElementRegistry::define(String const& name, We
|
||||
|
||||
// NOTE: This is not in the spec, but is required because of how we catch the exception by using a lambda, meaning we need to define this
|
||||
// variable outside of it to use it later.
|
||||
CustomElementDefinition::LifecycleCallbacksStorage lifecycle_callbacks;
|
||||
OrderedHashMap<FlyString, GC::Root<WebIDL::CallbackType>> lifecycle_callbacks;
|
||||
|
||||
// 14. Run the following steps while catching any exceptions:
|
||||
auto get_definition_attributes_from_constructor = [&]() -> JS::ThrowCompletionOr<void> {
|
||||
|
||||
Reference in New Issue
Block a user