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:
parent
05c80cac20
commit
386867da9f
3 changed files with 12 additions and 4 deletions
|
@ -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&) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue