2022-11-22 01:20:51 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2020-2021, Andreas Kling <andreas@ladybird.org>
|
2022-11-22 01:20:51 -03:00
|
|
|
* 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>
|
2025-07-19 17:49:30 -03:00
|
|
|
#include <LibJS/Export.h>
|
2022-11-22 01:20:51 -03:00
|
|
|
#include <LibJS/Runtime/Value.h>
|
|
|
|
|
|
2026-06-21 14:03:10 -03:00
|
|
|
namespace AK {
|
|
|
|
|
|
|
|
|
|
class Stream;
|
|
|
|
|
class Utf16StringBuilder;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-22 01:20:51 -03:00
|
|
|
namespace JS {
|
2025-05-13 08:06:33 -03:00
|
|
|
|
2022-11-22 01:20:51 -03:00
|
|
|
struct PrintContext {
|
|
|
|
|
JS::VM& vm;
|
2026-06-21 14:03:10 -03:00
|
|
|
AK::Stream* stream { nullptr };
|
|
|
|
|
AK::Utf16StringBuilder* builder { nullptr };
|
2022-11-22 01:20:51 -03:00
|
|
|
bool strip_ansi { false };
|
2025-06-02 10:38:08 -03:00
|
|
|
bool raw_strings { false };
|
2022-11-22 01:20:51 -03:00
|
|
|
};
|
|
|
|
|
|
2025-07-19 17:49:30 -03:00
|
|
|
JS_API ErrorOr<void> print(JS::Value value, PrintContext&);
|
2025-05-13 08:06:33 -03:00
|
|
|
|
2022-11-22 01:20:51 -03:00
|
|
|
}
|