mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibJS: Make JS::Cell non-copyable and non-movable
Also make the JS::Cell default constructor protected to provove a compilation error if you tried to allocate a plain cell.
This commit is contained in:
parent
eb1fef2be6
commit
fbb16073d1
1 changed files with 7 additions and 0 deletions
|
@ -27,11 +27,15 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <LibJS/Forward.h>
|
||||
|
||||
namespace JS {
|
||||
|
||||
class Cell {
|
||||
AK_MAKE_NONCOPYABLE(Cell);
|
||||
AK_MAKE_NONMOVABLE(Cell);
|
||||
|
||||
public:
|
||||
virtual ~Cell() {}
|
||||
|
||||
|
@ -54,6 +58,9 @@ public:
|
|||
Heap& heap() const;
|
||||
Interpreter& interpreter();
|
||||
|
||||
protected:
|
||||
Cell() {}
|
||||
|
||||
private:
|
||||
bool m_mark { false };
|
||||
bool m_live { true };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue