1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:48:10 +00:00

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
parent 1f4e3dd073
commit 1b391d78ae
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);
}