Forráskód Böngészése

LibJS: Make Heap a friend of everyone who uses JS_CELL

This will allow Heap to invoke non-public constructors when allocating
new cells.
Andreas Kling 2 éve
szülő
commit
d54ba587f3
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      Userland/Libraries/LibJS/Heap/Cell.h

+ 2 - 1
Userland/Libraries/LibJS/Heap/Cell.h

@@ -20,7 +20,8 @@ public:                                            \
     virtual StringView class_name() const override \
     {                                              \
         return #class_##sv;                        \
-    }
+    }                                              \
+    friend class JS::Heap;
 
 class Cell {
     AK_MAKE_NONCOPYABLE(Cell);