mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 10:52:44 +00:00 
			
		
		
		
	 84502f53b5
			
		
	
	
		84502f53b5
		
	
	
	
	
		
			
			And make it capable of printing to any Core::Stream. This is useful on its own and can be used in a number of places, so move it out and make it available as JS::print().
		
			
				
	
	
		
			23 lines
		
	
	
	
		
			523 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
	
		
			523 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020-2021, Andreas Kling <kling@serenityos.org>
 | |
|  * Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
 | |
|  * Copyright (c) 2022, Ali Mohammad Pur <mpfard@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/HashTable.h>
 | |
| #include <LibCore/Stream.h>
 | |
| #include <LibJS/Runtime/Value.h>
 | |
| 
 | |
| namespace JS {
 | |
| struct PrintContext {
 | |
|     JS::VM& vm;
 | |
|     Core::Stream::Stream& stream;
 | |
|     bool strip_ansi { false };
 | |
| };
 | |
| 
 | |
| ErrorOr<void> print(JS::Value value, PrintContext&);
 | |
| }
 |