From 59982ef5824ca0f50955dfce4a102acf0b1dbd66 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 11 Sep 2021 19:17:38 +0300 Subject: [PATCH] LibJS: Visit GeneratorObject's previous value if it's any kind of Cell Not just if it's an Object (which is one kind of Cell). --- Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp b/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp index 60a7df6082..23853be5c6 100644 --- a/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GeneratorObject.cpp @@ -46,8 +46,7 @@ void GeneratorObject::visit_edges(Cell::Visitor& visitor) Base::visit_edges(visitor); visitor.visit(m_environment); visitor.visit(m_generating_function); - if (m_previous_value.is_object()) - visitor.visit(&m_previous_value.as_object()); + visitor.visit(m_previous_value); } Value GeneratorObject::next_impl(VM& vm, GlobalObject& global_object, Optional value_to_throw)