ladybird/Userland/Libraries/LibJS/Print.h
Ali Mohammad Pur 84502f53b5 LibJS+js: Move the value print implementation to LibJS
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().
2022-11-26 02:23:15 +03:30

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&);
}