mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Make new lines in block comments reset line has token
Before this a closing html comment would not be treated as a comment if directly following a block comment which was not the first token of its first line.
This commit is contained in:
@@ -530,6 +530,7 @@ Token Lexer::next()
|
||||
consume();
|
||||
} while (!is_eof() && !is_line_terminator());
|
||||
} else if (is_block_comment_start()) {
|
||||
size_t start_line_number = m_line_number;
|
||||
consume();
|
||||
do {
|
||||
consume();
|
||||
@@ -540,6 +541,9 @@ Token Lexer::next()
|
||||
if (is_eof())
|
||||
unterminated_comment = true;
|
||||
consume(); // consume /
|
||||
|
||||
if (start_line_number != m_line_number)
|
||||
line_has_token_yet = false;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user