1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:27:39 +00:00

LibJS: Store PrivateElement values in Handle<Value>

This fixes an issue where private element values were not always
protected from GC. I found two instances where this was happening:

- ECMAScriptFunctionObject did not mark m_private_methods
- ClassDefinitionEvaluation had two Vector<PrivateElement> that were
  opaque to the garbage collector, and so if GC occurred while
  constructing a class instance, some or all of its private elements
  could get incorrectly collected.
This commit is contained in:
Andreas Kling 2023-06-02 08:17:28 +02:00
parent 0eddee44f3
commit 5617dd1c83
3 changed files with 14 additions and 19 deletions

View file

@ -36,7 +36,7 @@ struct PrivateElement {
PrivateName key;
Kind kind { Kind::Field };
Value value;
Handle<Value> value;
};
class Object : public Cell {