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

LibJS: Remove DeprecatedString usage from Token

This commit is contained in:
Evan Smal 2023-01-26 08:38:09 -05:00 committed by Linus Groh
parent 93674e4383
commit cfa6b4d815
3 changed files with 9 additions and 9 deletions

View file

@ -836,7 +836,7 @@ Token Lexer::next()
if (m_hit_invalid_unicode.has_value()) {
value_start = m_hit_invalid_unicode.value() - 1;
m_current_token = Token(TokenType::Invalid, "Invalid unicode codepoint in source",
m_current_token = Token(TokenType::Invalid, String::from_utf8("Invalid unicode codepoint in source"sv).release_value_but_fixme_should_propagate_errors(),
""sv, // Since the invalid unicode can occur anywhere in the current token the trivia is not correct
m_source.substring_view(value_start + 1, min(4u, m_source.length() - value_start - 2)),
m_filename,
@ -849,7 +849,7 @@ Token Lexer::next()
} else {
m_current_token = Token(
token_type,
token_message,
String::from_deprecated_string(token_message).release_value_but_fixme_should_propagate_errors(),
m_source.substring_view(trivia_start - 1, value_start - trivia_start),
m_source.substring_view(value_start - 1, m_position - value_start),
m_filename,
@ -893,7 +893,7 @@ Token Lexer::force_slash_as_regex()
m_current_token = Token(
token_type,
"",
String {},
m_current_token.trivia(),
m_source.substring_view(value_start - 1, m_position - value_start),
m_filename,