summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-10-01 17:17:57 +0300
committerLinus Groh <mail@linusgroh.de>2022-10-01 15:36:20 +0100
commit5c814e66b3bdafb6e3081bd41512b64c96a074d5 (patch)
tree2e45417ebe4bb3bf343eb3f900e8a26cc20f7487 /Userland/Libraries
parent4aade74b912488bf63eaa2d525fb30b7680d382e (diff)
downloadserenity-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.h3
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;
};
}