diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2023-02-25 10:44:31 -0700 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-06 13:05:43 +0000 |
commit | 70a2ca7fc0939dd0d61691c17e108c6169ef6d30 (patch) | |
tree | f798d956bba744bc7c607508be52532e5055096b /Userland/Libraries/LibJS | |
parent | 74e93a46eaf9be3c3835682ab2c190c75371ac86 (diff) | |
download | serenity-70a2ca7fc0939dd0d61691c17e108c6169ef6d30.zip |
LibJS: Handle both const and non-const Ts in Handle<T>::create()
Again, the const-ness only really involves Heap-internal metadata, so
the callers shouldn't care about mutations here.
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Heap/Handle.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Heap/Handle.h b/Userland/Libraries/LibJS/Heap/Handle.h index cfcf70e9bc..6eacb467e2 100644 --- a/Userland/Libraries/LibJS/Heap/Handle.h +++ b/Userland/Libraries/LibJS/Heap/Handle.h @@ -46,7 +46,7 @@ public: static Handle create(T* cell) { - return Handle(adopt_ref(*new HandleImpl(cell))); + return Handle(adopt_ref(*new HandleImpl(const_cast<RemoveConst<T>*>(cell)))); } Handle(T* cell) |