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

LibJS: Use new format functions everywhere

This changes the remaining uses of the following functions across LibJS:

- String::format() => String::formatted()
- dbg() => dbgln()
- printf() => out(), outln()
- fprintf() => warnln()

I also removed the relevant 'LogStream& operator<<' overloads as they're
not needed anymore.
This commit is contained in:
Linus Groh 2020-12-06 16:55:19 +00:00 committed by Andreas Kling
parent 2313e58393
commit 5eb1f752ab
15 changed files with 151 additions and 171 deletions

View file

@ -26,7 +26,7 @@
#pragma once
#include <AK/LogStream.h>
#include <AK/Format.h>
#include <AK/Types.h>
namespace JS {
@ -87,8 +87,18 @@ private:
u8 m_bits;
};
const LogStream& operator<<(const LogStream& stream, const PropertyAttributes& attributes);
const PropertyAttributes default_attributes = Attribute::Configurable | Attribute::Writable | Attribute::Enumerable;
}
namespace AK {
template<>
struct Formatter<JS::PropertyAttributes> : Formatter<u8> {
void format(TypeErasedFormatParams& params, FormatBuilder& builder, const JS::PropertyAttributes& attributes)
{
Formatter<u8>::format(params, builder, attributes.bits());
}
};
}