diff options
author | Andreas Kling <kling@serenityos.org> | 2021-12-12 22:06:43 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-16 22:48:17 +0100 |
commit | c26b58bc535c5dbc5095d370641af7fa818dfa8e (patch) | |
tree | 8510ff9be0707988d81d54c72a9827d2458f94f4 /Userland/Libraries/LibJS/Heap | |
parent | 13680ae0380367217358d94d1fe877b88fd7bea3 (diff) | |
download | serenity-c26b58bc535c5dbc5095d370641af7fa818dfa8e.zip |
LibJS: Add JS::make_handle(T&)
I'm not sure why we only had a T* variant of this.
Diffstat (limited to 'Userland/Libraries/LibJS/Heap')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Handle.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index 8aee4a348b..5df24c7d03 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/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); +} + } |