1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:47:35 +00:00

LibJS: Add make_handle({Nonnull,}GCPtr<T>) overloads

This commit is contained in:
Linus Groh 2022-12-14 18:37:37 +00:00 committed by Tim Flynn
parent 029db614e3
commit 2a66fc6cae
5 changed files with 18 additions and 4 deletions

View file

@ -121,6 +121,20 @@ inline Handle<T> make_handle(T& cell)
return Handle<T>::create(&cell);
}
template<class T>
inline Handle<T> make_handle(GCPtr<T> cell)
{
if (!cell)
return Handle<T> {};
return Handle<T>::create(cell.ptr());
}
template<class T>
inline Handle<T> make_handle(NonnullGCPtr<T> cell)
{
return Handle<T>::create(cell.ptr());
}
template<>
class Handle<Value> {
public: