1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

LibJS: Integrate Symbols into objects as valid keys

This allows objects properties to be created for symbol keys in addition
to just plain strings/numbers
This commit is contained in:
Matthew Olsson 2020-07-07 21:38:46 -07:00 committed by Andreas Kling
parent 9783a4936c
commit 7a1d485b19
14 changed files with 424 additions and 154 deletions

View file

@ -41,13 +41,13 @@ public:
const String& description() const { return m_description; }
bool is_global() const { return m_is_global; }
const String to_string() const { return String::format("Symbol(%s)", description().characters()); }
String to_string() const { return String::format("Symbol(%s)", description().characters()); }
private:
virtual const char* class_name() const override { return "Symbol"; }
const String m_description;
const bool m_is_global;
String m_description;
bool m_is_global;
};
Symbol* js_symbol(Heap&, String description, bool is_global);