summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Libraries/LibJS/CMakeLists.txt1
-rw-r--r--Userland/Libraries/LibJS/Heap/Cell.cpp26
-rw-r--r--Userland/Libraries/LibJS/Heap/Cell.h6
-rw-r--r--Userland/Libraries/LibJS/Runtime/Value.h6
4 files changed, 11 insertions, 28 deletions
diff --git a/Userland/Libraries/LibJS/CMakeLists.txt b/Userland/Libraries/LibJS/CMakeLists.txt
index 965c3db6d7..86a78ff059 100644
--- a/Userland/Libraries/LibJS/CMakeLists.txt
+++ b/Userland/Libraries/LibJS/CMakeLists.txt
@@ -2,7 +2,6 @@ set(SOURCES
AST.cpp
Console.cpp
Heap/Allocator.cpp
- Heap/Cell.cpp
Heap/Handle.cpp
Heap/HeapBlock.cpp
Heap/Heap.cpp
diff --git a/Userland/Libraries/LibJS/Heap/Cell.cpp b/Userland/Libraries/LibJS/Heap/Cell.cpp
deleted file mode 100644
index 54ecbd1ebd..0000000000
--- a/Userland/Libraries/LibJS/Heap/Cell.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#include <LibJS/Heap/Cell.h>
-#include <LibJS/Heap/Heap.h>
-#include <LibJS/Heap/HeapBlock.h>
-#include <LibJS/Runtime/Value.h>
-
-namespace JS {
-
-void Cell::Visitor::visit(Cell* cell)
-{
- if (cell)
- visit_impl(cell);
-}
-
-void Cell::Visitor::visit(Value value)
-{
- if (value.is_cell())
- visit_impl(value.as_cell());
-}
-
-}
diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h
index bc0e6a9e23..d5d61ca442 100644
--- a/Userland/Libraries/LibJS/Heap/Cell.h
+++ b/Userland/Libraries/LibJS/Heap/Cell.h
@@ -33,7 +33,11 @@ public:
class Visitor {
public:
- void visit(Cell*);
+ void visit(Cell* cell)
+ {
+ if (cell)
+ visit_impl(cell);
+ }
void visit(Value);
protected:
diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h
index 8e68556b01..f4ca977faa 100644
--- a/Userland/Libraries/LibJS/Runtime/Value.h
+++ b/Userland/Libraries/LibJS/Runtime/Value.h
@@ -327,6 +327,12 @@ inline Value js_negative_infinity()
return Value(-INFINITY);
}
+inline void Cell::Visitor::visit(Value value)
+{
+ if (value.is_cell())
+ visit_impl(value.as_cell());
+}
+
Value greater_than(GlobalObject&, Value lhs, Value rhs);
Value greater_than_equals(GlobalObject&, Value lhs, Value rhs);
Value less_than(GlobalObject&, Value lhs, Value rhs);