From 3143fea1ebbb527918a8b508641c8554c013efb1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 8 Sep 2020 15:37:39 +0200 Subject: [PATCH] LibJS: GlobalObject needs to mark the iterator prototypes Otherwise they all disappear in the first garbage collection. --- Libraries/LibJS/Runtime/GlobalObject.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/LibJS/Runtime/GlobalObject.cpp b/Libraries/LibJS/Runtime/GlobalObject.cpp index 7f07d5f9c8..58e5097275 100644 --- a/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -143,6 +143,11 @@ void GlobalObject::visit_children(Visitor& visitor) visitor.visit(m_##snake_name##_constructor); JS_ENUMERATE_ERROR_SUBCLASSES #undef __JS_ENUMERATE + +#define __JS_ENUMERATE(ClassName, snake_name) \ + visitor.visit(m_##snake_name##_prototype); + JS_ENUMERATE_ITERATOR_PROTOTYPES +#undef __JS_ENUMERATE } JS_DEFINE_NATIVE_FUNCTION(GlobalObject::gc)