mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
LibJS: Add JS_CELL macro and use it in all JS::Cell subclasses
This is similar to what we already had with JS_OBJECT (and also JS_ENVIRONMENT) but sits at the top of the Cell inheritance hierarchy.
This commit is contained in:
parent
94f016b363
commit
6e973ce69b
16 changed files with 37 additions and 23 deletions
|
@ -13,6 +13,8 @@
|
|||
namespace JS {
|
||||
|
||||
struct RemainingElements final : public Cell {
|
||||
JS_CELL(RemainingElements, Cell);
|
||||
|
||||
RemainingElements() = default;
|
||||
|
||||
explicit RemainingElements(u64 initial_value)
|
||||
|
@ -20,12 +22,12 @@ struct RemainingElements final : public Cell {
|
|||
{
|
||||
}
|
||||
|
||||
virtual StringView class_name() const override { return "RemainingElements"sv; }
|
||||
|
||||
u64 value { 0 };
|
||||
};
|
||||
|
||||
class PromiseValueList final : public Cell {
|
||||
JS_CELL(PromiseValueList, Cell);
|
||||
|
||||
public:
|
||||
PromiseValueList()
|
||||
{
|
||||
|
@ -35,7 +37,6 @@ public:
|
|||
Vector<Value> const& values() const { return m_values; }
|
||||
|
||||
private:
|
||||
virtual StringView class_name() const override { return "PromiseValueList"sv; }
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
Vector<Value> m_values;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue