mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-02 01:08:48 +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
Notes:
sideshowbarker
2024-07-19 08:47:44 +09:00
Author: https://github.com/awesomekling
Commit: 386867da9f
3 changed files with 12 additions and 4 deletions
|
@ -51,10 +51,8 @@ void Object::put(String property_name, Value value)
|
|||
void Object::visit_children(Cell::Visitor& visitor)
|
||||
{
|
||||
Cell::visit_children(visitor);
|
||||
for (auto& it : m_properties) {
|
||||
if (it.value.is_object())
|
||||
visitor.visit(it.value.as_object());
|
||||
}
|
||||
for (auto& it : m_properties)
|
||||
visitor.visit(it.value);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue