mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibWeb: Don't assert if reconsuming on an empty TokenStream
This fixes #9978. When a TokenStream is empty, reading its `current_token()` still returns a token (for EOF) so it makes sense to allow users to `reconsume_current_input_token()` that token, so they do not have to handle that themselves. Instead of VERIFY()ing, we can just no-op when reconsuming token 0.
This commit is contained in:
parent
f58f58fb77
commit
8ddce2faaf
1 changed files with 2 additions and 2 deletions
|
@ -105,8 +105,8 @@ T const& TokenStream<T>::current_token()
|
|||
template<typename T>
|
||||
void TokenStream<T>::reconsume_current_input_token()
|
||||
{
|
||||
VERIFY(m_iterator_offset >= 0);
|
||||
--m_iterator_offset;
|
||||
if (m_iterator_offset >= 0)
|
||||
--m_iterator_offset;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue