1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibJS: Keep handles on internal function while creating a class

It seems the stack search does not find all functions because they are
kept in variants and other structs. This meant some function could be
cleaned up while we were evaluating a class meaning it would fail/crash
when attempting to run the functions.
This commit is contained in:
davidot 2022-02-04 16:22:29 +01:00 committed by Andreas Kling
parent 5749d85534
commit 212c8dad5e
2 changed files with 16 additions and 12 deletions

View file

@ -17,6 +17,7 @@
#include <AK/Variant.h>
#include <AK/Vector.h>
#include <LibJS/Forward.h>
#include <LibJS/Heap/Handle.h>
#include <LibJS/Runtime/Completion.h>
#include <LibJS/Runtime/EnvironmentCoordinate.h>
#include <LibJS/Runtime/FunctionKind.h>
@ -1225,7 +1226,7 @@ public:
struct ClassFieldDefinition {
ClassElementName name;
ECMAScriptFunctionObject* initializer { nullptr };
Handle<ECMAScriptFunctionObject> initializer;
};
// We use the Completion also as a ClassStaticBlockDefinition Record.