mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-25 18:52:22 -05:00
LibJS: Handle empty values in Value::to_string()
This commit is contained in:
parent
e4ba949a15
commit
755b206618
Notes:
sideshowbarker
2024-07-19 07:47:39 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/755b2066185 Pull-request: https://github.com/SerenityOS/serenity/pull/1702
1 changed files with 5 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue