1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:15:07 +00:00

LibJS: Add a convenience helper for visiting a JS::Value

We only really care to visit values if they refer to a Cell, but it's
nice to be able to say visit(some_value).
This commit is contained in:
Andreas Kling 2020-03-09 22:14:51 +01:00
parent 05c80cac20
commit 386867da9f
3 changed files with 12 additions and 4 deletions

View file

@ -27,6 +27,7 @@
#pragma once
#include <AK/Forward.h>
#include <LibJS/Forward.h>
namespace JS {
@ -45,6 +46,7 @@ public:
class Visitor {
public:
virtual void visit(Cell*) = 0;
void visit(Value);
};
virtual void visit_children(Visitor&) {}