1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

LibJS: Handle empty values in operator<<()

Otherwise something like dbg() << Value(); chokes on
ASSERT_NOT_REACHED() in Value::to_string()
This commit is contained in:
Linus Groh 2020-05-12 21:36:19 +01:00 committed by Andreas Kling
parent fbeaf76f96
commit 063228c02e

View file

@ -370,7 +370,7 @@ Value instance_of(Interpreter&, Value lhs, Value rhs)
const LogStream& operator<<(const LogStream& stream, const Value& value)
{
return stream << value.to_string();
return stream << (value.is_empty() ? "<empty>" : value.to_string());
}
bool same_value(Interpreter& interpreter, Value lhs, Value rhs)