Explorar el Código

LibJS: Add JS::make_handle(T&)

I'm not sure why we only had a T* variant of this.
Andreas Kling hace 3 años
padre
commit
c26b58bc53
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      Userland/Libraries/LibJS/Heap/Handle.h

+ 6 - 0
Userland/Libraries/LibJS/Heap/Handle.h

@@ -71,4 +71,10 @@ inline Handle<T> make_handle(T* cell)
     return Handle<T>::create(cell);
 }
 
+template<class T>
+inline Handle<T> make_handle(T& cell)
+{
+    return Handle<T>::create(&cell);
+}
+
 }