mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:32:46 +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:
		
							parent
							
								
									2313e58393
								
							
						
					
					
						commit
						5eb1f752ab
					
				
					 15 changed files with 151 additions and 171 deletions
				
			
		|  | @ -26,8 +26,10 @@ | |||
| 
 | ||||
| #pragma once | ||||
| 
 | ||||
| #include <AK/Format.h> | ||||
| #include <AK/Forward.h> | ||||
| #include <AK/Noncopyable.h> | ||||
| #include <AK/String.h> | ||||
| #include <LibJS/Forward.h> | ||||
| 
 | ||||
| namespace JS { | ||||
|  | @ -70,6 +72,19 @@ private: | |||
|     bool m_live { true }; | ||||
| }; | ||||
| 
 | ||||
| const LogStream& operator<<(const LogStream&, const Cell*); | ||||
| } | ||||
| 
 | ||||
| namespace AK { | ||||
| 
 | ||||
| template<> | ||||
| struct Formatter<JS::Cell> : Formatter<StringView> { | ||||
|     void format(TypeErasedFormatParams& params, FormatBuilder& builder, const JS::Cell* cell) | ||||
|     { | ||||
|         if (!cell) | ||||
|             Formatter<StringView>::format(params, builder, "Cell{nullptr}"); | ||||
|         else | ||||
|             Formatter<StringView>::format(params, builder, String::formatted("{}{{{}}}", cell->class_name(), static_cast<const void*>(cell))); | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Linus Groh
						Linus Groh