mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
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.
This commit is contained in:
parent
4aade74b91
commit
5c814e66b3
Notes:
sideshowbarker
2024-07-17 06:29:38 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/5c814e66b3 Pull-request: https://github.com/SerenityOS/serenity/pull/15418 Issue: https://github.com/SerenityOS/serenity/issues/14182 Reviewed-by: https://github.com/linusg ✅
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user