LibJS: Allow cells to mark null pointers

This simplifies the cell visiting functions by letting them not worry
about the pointers they pass to the visitor being null.
This commit is contained in:
Andreas Kling 2020-04-16 16:07:50 +02:00
commit 1b391d78ae
Notes: sideshowbarker 2024-07-19 07:33:06 +09:00
5 changed files with 16 additions and 13 deletions

View file

@ -45,8 +45,7 @@ LexicalEnvironment::~LexicalEnvironment()
void LexicalEnvironment::visit_children(Visitor& visitor)
{
Cell::visit_children(visitor);
if (m_parent)
visitor.visit(m_parent);
visitor.visit(m_parent);
for (auto& it : m_variables)
visitor.visit(it.value.value);
}