mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 17:49:40 +00:00
LibJS: Add to_string definitions to CodeGenerationError and ParserError
This commit is contained in:
parent
f7458b3e17
commit
93ad25fbe5
Notes:
sideshowbarker
2024-07-17 06:46:15 +09:00
Author: https://github.com/trflynn89
Commit: 93ad25fbe5
Pull-request: https://github.com/SerenityOS/serenity/pull/17494
Reviewed-by: https://github.com/linusg ✅
5 changed files with 30 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue