1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +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

@ -146,7 +146,7 @@ void MarkupGenerator::object_to_html(const Object& object, StringBuilder& html_o
size_t index = 0;
for (auto& it : object.shape().property_table_ordered()) {
html_output.append(wrap_string_in_style(String::format("\"%s\"", it.key.characters()), StyleType::String));
html_output.append(wrap_string_in_style(String::format("\"%s\"", it.key.to_display_string().characters()), StyleType::String));
html_output.append(wrap_string_in_style(": ", StyleType::Punctuation));
value_to_html(object.get_direct(it.value.offset), html_output, seen_objects);
if (index != object.shape().property_count() - 1)