1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

LibJS: Add to_string definitions to CodeGenerationError and ParserError

This commit is contained in:
Timothy Flynn 2023-02-16 11:03:49 -05:00 committed by Tim Flynn
parent f7458b3e17
commit 93ad25fbe5
5 changed files with 30 additions and 0 deletions

View file

@ -12,6 +12,13 @@
namespace JS {
ErrorOr<String> ParserError::to_string() const
{
if (!position.has_value())
return String::from_deprecated_string(message);
return String::formatted("{} (line: {}, column: {})", message, position.value().line, position.value().column);
}
DeprecatedString ParserError::to_deprecated_string() const
{
if (!position.has_value())