diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-10-01 17:17:57 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-01 15:36:20 +0100 |
commit | 5c814e66b3bdafb6e3081bd41512b64c96a074d5 (patch) | |
tree | 2e45417ebe4bb3bf343eb3f900e8a26cc20f7487 /Userland/Libraries | |
parent | 4aade74b912488bf63eaa2d525fb30b7680d382e (diff) | |
download | serenity-5c814e66b3bdafb6e3081bd41512b64c96a074d5.zip |
LibJS: Store symbols in a Handle inside PropertyKey
If the stored symbol is custom (non-global), it is allocated on the
heap, and may not be visited by anyone else, so we must register it in
order to keep it alive.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PropertyKey.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index 3dfb6a0779..5be70863fa 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -7,6 +7,7 @@ #pragma once #include <AK/FlyString.h> +#include <LibJS/Heap/Handle.h> #include <LibJS/Runtime/Completion.h> #include <LibJS/Runtime/StringOrSymbol.h> @@ -186,7 +187,7 @@ private: Type m_type { Type::Invalid }; u32 m_number { 0 }; FlyString m_string; - Symbol* m_symbol { nullptr }; + Handle<Symbol> m_symbol; }; } |