1326454 - Add assertions to TokenStream::skipChars{,IgnoreEOL} verifying EOF isn't yet hit and that newlines aren't skipped, if appropriate.

This commit is contained in:
Gaming4JC 2019-06-08 15:55:51 -04:00 committed by Roy Tam
commit 6828c2c09b

View file

@ -997,13 +997,18 @@ class MOZ_STACK_CLASS TokenStream
}
void skipChars(uint8_t n) {
while (n-- > 0)
getChar();
while (n-- > 0) {
MOZ_ASSERT(userbuf.hasRawChars());
mozilla::DebugOnly<int32_t> c = getCharIgnoreEOL();
MOZ_ASSERT(c != '\n');
}
}
void skipCharsIgnoreEOL(uint8_t n) {
while (n-- > 0)
while (n-- > 0) {
MOZ_ASSERT(userbuf.hasRawChars());
getCharIgnoreEOL();
}
}
void updateLineInfoForEOL();