mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibJS: Simplify LogStream::operator<<(JS::Value) and move to .cpp file
This commit is contained in:
parent
cbe0053a97
commit
d52130836e
Notes:
sideshowbarker
2024-07-19 08:51:07 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/d52130836ee
2 changed files with 6 additions and 12 deletions
|
@ -53,4 +53,9 @@ String Value::to_string() const
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
const LogStream& operator<<(const LogStream& stream, const Value& value)
|
||||
{
|
||||
return stream << value.to_string();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -123,17 +123,6 @@ inline Value js_null()
|
|||
return Value(Value::Type::Null);
|
||||
}
|
||||
|
||||
inline const LogStream& operator<<(const LogStream& stream, const Value& value)
|
||||
{
|
||||
switch (value.type()) {
|
||||
case Value::Type::Boolean:
|
||||
return stream << value.as_bool();
|
||||
case Value::Type::Number:
|
||||
return stream << (i32)value.as_double();
|
||||
default:
|
||||
ASSERT_NOT_REACHED();
|
||||
return stream;
|
||||
}
|
||||
}
|
||||
const LogStream& operator<<(const LogStream&, const Value&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue