mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 00:25:12 +00:00
LibJS: Add to_string definitions to CodeGenerationError and ParserError
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user