1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibJS: Don't use MarkedValueList in PromiseValueList

Instead, override visit_edges() and mark the values like any other Cell
subclass would.

This makes PromiseValueList play nice with zombification.
This commit is contained in:
Andreas Kling 2021-09-11 22:16:30 +02:00
parent 2253235a0f
commit 971dc44ed3
3 changed files with 19 additions and 15 deletions

View file

@ -24,15 +24,19 @@ struct RemainingElements final : public Cell {
u64 value { 0 };
};
struct PromiseValueList final : public Cell {
class PromiseValueList final : public Cell {
public:
PromiseValueList()
: values(heap())
{
}
Vector<Value>& values() { return m_values; }
Vector<Value> const& values() const { return m_values; }
private:
virtual const char* class_name() const override { return "PromiseValueList"; }
MarkedValueList values;
Vector<Value> m_values;
};
class PromiseResolvingElementFunction : public NativeFunction {