mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
LibJS: Add make_handle({Nonnull,}GCPtr<T>) overloads
This commit is contained in:
parent
029db614e3
commit
2a66fc6cae
Notes:
sideshowbarker
2024-07-17 06:09:44 +09:00
Author: https://github.com/linusg
Commit: 2a66fc6cae
Pull-request: https://github.com/SerenityOS/serenity/pull/16498
Reviewed-by: https://github.com/trflynn89 ✅
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