1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 22:35:08 +00:00

LibJS: Use enumerator macro to mark all constructors in GlobalObject

We were forgetting to mark the String constructor! So this patch fixes
that and ensures we won't forget anyone in the future.
This commit is contained in:
Andreas Kling 2020-04-18 11:02:05 +02:00
parent bc1ece7f37
commit 30de1f610d

View file

@ -90,13 +90,10 @@ void GlobalObject::visit_children(Visitor& visitor)
{ {
Object::visit_children(visitor); Object::visit_children(visitor);
visitor.visit(m_array_constructor); #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName) \
visitor.visit(m_boolean_constructor); visitor.visit(m_##snake_name##_constructor);
visitor.visit(m_date_constructor); JS_ENUMERATE_ERROR_SUBCLASSES
visitor.visit(m_error_constructor); #undef __JS_ENUMERATE
visitor.visit(m_function_constructor);
visitor.visit(m_number_constructor);
visitor.visit(m_object_constructor);
} }
Value GlobalObject::gc(Interpreter& interpreter) Value GlobalObject::gc(Interpreter& interpreter)