mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
LibJS: Add make_handle({Nonnull,}GCPtr<T>) overloads
This commit is contained in:
parent
029db614e3
commit
2a66fc6cae
5 changed files with 18 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue