ladybird/Libraries/LibJS/Print.h
Andreas Kling b6bef6b688 Libraries: Use UTF-16 for JS-visible runtime strings
Produce JS-visible string results as UTF-16 at their source, including
numeric formatting, BigInt and BigFraction formatting, URI encoding,
console formatting, parser errors, regular expression errors, Intl and
Temporal records, LibUnicode locale boundaries, and LibWeb bindings.

Handle fractional radix formatting through the UTF-16 builder view.
2026-06-22 19:51:25 +02:00

34 lines
673 B
C++

/*
* Copyright (c) 2020-2021, Andreas Kling <andreas@ladybird.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 <LibJS/Export.h>
#include <LibJS/Runtime/Value.h>
namespace AK {
class Stream;
class Utf16StringBuilder;
}
namespace JS {
struct PrintContext {
JS::VM& vm;
AK::Stream* stream { nullptr };
AK::Utf16StringBuilder* builder { nullptr };
bool strip_ansi { false };
bool raw_strings { false };
};
JS_API ErrorOr<void> print(JS::Value value, PrintContext&);
}