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

LibJS: Handle empty values in Value::to_string()

This commit is contained in:
Linus Groh 2020-04-08 17:38:09 +01:00 committed by Andreas Kling
parent e4ba949a15
commit 755b206618

View file

@ -161,6 +161,11 @@ static void print_error(const JS::Object& object, HashTable<JS::Object*>&)
void print_value(JS::Value value, HashTable<JS::Object*>& seen_objects)
{
if (value.is_empty()) {
printf("\033[34;1m<empty>\033[0m");
return;
}
if (value.is_object()) {
if (seen_objects.contains(&value.as_object())) {
// FIXME: Maybe we should only do this for circular references,