mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibJS: Don't leak class field initializers
We were storing these in Handle (strong GC roots) hanging off of ECMAScriptFunctionObject which effectively turned into world leaks.
This commit is contained in:
parent
8c809fa5ee
commit
5aa1d7837f
Notes:
github-actions[bot]
2024-11-10 18:13:56 +00:00
Author: https://github.com/awesomekling
Commit: 5aa1d7837f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2268
4 changed files with 7 additions and 6 deletions
|
@ -227,7 +227,7 @@ ThrowCompletionOr<ClassElement::ClassValue> ClassField::class_element_evaluation
|
|||
auto& realm = *vm.current_realm();
|
||||
|
||||
auto property_key_or_private_name = TRY(class_key_to_property_name(vm, *m_key, property_key));
|
||||
Handle<ECMAScriptFunctionObject> initializer {};
|
||||
GCPtr<ECMAScriptFunctionObject> initializer;
|
||||
if (m_initializer) {
|
||||
auto copy_initializer = m_initializer;
|
||||
auto name = property_key_or_private_name.visit(
|
||||
|
@ -370,7 +370,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::create_class_const
|
|||
|
||||
ConservativeVector<PrivateElement> static_private_methods(vm.heap());
|
||||
ConservativeVector<PrivateElement> instance_private_methods(vm.heap());
|
||||
Vector<ClassFieldDefinition> instance_fields;
|
||||
ConservativeVector<ClassFieldDefinition> instance_fields(vm.heap());
|
||||
Vector<StaticElement> static_elements;
|
||||
|
||||
for (size_t element_index = 0; element_index < m_elements.size(); element_index++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue