diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index 549d06c356..827c413860 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -13,6 +13,7 @@ #include #include #include +#include namespace JS { @@ -53,22 +54,30 @@ public: if (cell) visit_impl(*cell); } + void visit(Cell& cell) { visit_impl(cell); } + template void visit(GCPtr cell) { if (cell) visit_impl(*cell.ptr()); } + template void visit(NonnullGCPtr cell) { visit_impl(*cell.ptr()); } - void visit(Value); + + void visit(Value value) + { + if (value.is_cell()) + visit_impl(value.as_cell()); + } protected: virtual void visit_impl(Cell&) = 0; diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h index 16158e7e7d..ccab35cbd2 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/Date.h b/Userland/Libraries/LibJS/Runtime/Date.h index c1374e3ede..358752c06e 100644 --- a/Userland/Libraries/LibJS/Runtime/Date.h +++ b/Userland/Libraries/LibJS/Runtime/Date.h @@ -7,6 +7,7 @@ #pragma once +#include #include namespace JS { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h index e9d0ea131c..1ff11938ea 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/MathematicalValue.h @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace JS::Intl { diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp index 6b0d1054cd..53b0825bb3 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index 84ef955521..3b902d89f0 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index fa745b9d32..d4679254c2 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -19,7 +19,6 @@ #include #include #include -#include #include // 2 ** 53 - 1 @@ -526,12 +525,6 @@ inline Value js_negative_infinity() return Value(-INFINITY); } -inline void Cell::Visitor::visit(Value value) -{ - if (value.is_cell()) - visit_impl(value.as_cell()); -} - ThrowCompletionOr greater_than(VM&, Value lhs, Value rhs); ThrowCompletionOr greater_than_equals(VM&, Value lhs, Value rhs); ThrowCompletionOr less_than(VM&, Value lhs, Value rhs); diff --git a/Userland/Libraries/LibJS/Runtime/ValueTraits.h b/Userland/Libraries/LibJS/Runtime/ValueTraits.h index c88fddc709..efcbfd163b 100644 --- a/Userland/Libraries/LibJS/Runtime/ValueTraits.h +++ b/Userland/Libraries/LibJS/Runtime/ValueTraits.h @@ -8,6 +8,7 @@ #pragma once +#include #include #include diff --git a/Userland/Libraries/LibWeb/Layout/Box.h b/Userland/Libraries/LibWeb/Layout/Box.h index a02a4043ce..7bca93cdef 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.h +++ b/Userland/Libraries/LibWeb/Layout/Box.h @@ -8,6 +8,7 @@ #include #include +#include #include namespace Web::Layout { diff --git a/Userland/Libraries/LibWeb/Layout/Node.h b/Userland/Libraries/LibWeb/Layout/Node.h index 98ee636ad1..effb811f01 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.h +++ b/Userland/Libraries/LibWeb/Layout/Node.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/TreeNode.h b/Userland/Libraries/LibWeb/TreeNode.h index 74d7a94d40..f4142e79e1 100644 --- a/Userland/Libraries/LibWeb/TreeNode.h +++ b/Userland/Libraries/LibWeb/TreeNode.h @@ -8,6 +8,7 @@ #include #include +#include #include #include