mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-03 22:59:33 +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
|
@ -663,9 +663,9 @@ ThrowCompletionOr<void> Object::define_field(ClassFieldDefinition const& field)
|
|||
auto init_value = js_undefined();
|
||||
|
||||
// 3. If initializer is not empty, then
|
||||
if (!initializer.is_null()) {
|
||||
if (initializer) {
|
||||
// a. Let initValue be ? Call(initializer, receiver).
|
||||
init_value = TRY(call(vm, initializer.cell(), this));
|
||||
init_value = TRY(call(vm, initializer, this));
|
||||
}
|
||||
// 4. Else, let initValue be undefined.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue