LibWeb: Don't emit current token on EOF in HTML Tokenizer

Emitting tokens on EOF caused an infinite loop, freezing the app, which
could be a bit annoying when writing an HTML comment at the end of
the file in Text Editor. :^)
This commit is contained in:
Karol Kosek 2022-02-13 21:12:22 +01:00 committed by Ali Mohammad Pur
parent fb5e2670d6
commit c157c2148f
Notes: sideshowbarker 2024-07-17 18:52:40 +09:00

View file

@ -1356,7 +1356,6 @@ _StartOfFunction:
ON_EOF
{
log_parse_error();
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
@ -1388,7 +1387,6 @@ _StartOfFunction:
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
@ -1419,7 +1417,6 @@ _StartOfFunction:
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
@ -1447,7 +1444,6 @@ _StartOfFunction:
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE
@ -1468,7 +1464,6 @@ _StartOfFunction:
{
log_parse_error();
m_current_token.set_comment(consume_current_builder());
EMIT_CURRENT_TOKEN;
EMIT_EOF;
}
ANYTHING_ELSE