From 755b2066185016d0408dc63424064bfc229df791 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 8 Apr 2020 17:38:09 +0100 Subject: [PATCH] LibJS: Handle empty values in Value::to_string() --- Userland/js.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/js.cpp b/Userland/js.cpp index a66056be6d..f9f2a5c22d 100644 --- a/Userland/js.cpp +++ b/Userland/js.cpp @@ -161,6 +161,11 @@ static void print_error(const JS::Object& object, HashTable&) void print_value(JS::Value value, HashTable& seen_objects) { + if (value.is_empty()) { + printf("\033[34;1m\033[0m"); + return; + } + if (value.is_object()) { if (seen_objects.contains(&value.as_object())) { // FIXME: Maybe we should only do this for circular references,