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

LibJS: Add a specific test for invalid unicode characters in the lexer

Also fixes that it tried to make substrings past the end of the source
if we overran the source length.
This commit is contained in:
davidot 2021-10-03 13:10:35 +02:00 committed by Andreas Kling
parent 962298b040
commit ac2c3a73b1
4 changed files with 83 additions and 1 deletions

View file

@ -145,7 +145,7 @@ void Lexer::consume()
return false;
m_eof = true;
m_current_char = '\0';
m_position++;
m_position = m_source.length() + 1;
m_line_column++;
return true;
};