Explorar el Código

LibJS: GlobalObject needs to mark the iterator prototypes

Otherwise they all disappear in the first garbage collection.
Andreas Kling hace 4 años
padre
commit
3143fea1eb
Se han modificado 1 ficheros con 5 adiciones y 0 borrados
  1. 5 0
      Libraries/LibJS/Runtime/GlobalObject.cpp

+ 5 - 0
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)