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:
parent
9783a4936c
commit
7a1d485b19
14 changed files with 424 additions and 154 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue