Bug 475834 - Multiline comments with newlines in them should not decompose to nothing. r=brendan

This commit is contained in:
Blake Kaplan 2009-01-29 12:22:26 -08:00
Родитель 196e202090
Коммит 6c157b6873
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1802,6 +1802,7 @@ skipline:
} }
if (MatchChar(ts, '*')) { if (MatchChar(ts, '*')) {
uintN lineno = ts->lineno;
while ((c = GetChar(ts)) != EOF && while ((c = GetChar(ts)) != EOF &&
!(c == '*' && MatchChar(ts, '/'))) { !(c == '*' && MatchChar(ts, '/'))) {
/* Ignore all characters until comment close. */ /* Ignore all characters until comment close. */
@ -1811,6 +1812,11 @@ skipline:
JSMSG_UNTERMINATED_COMMENT); JSMSG_UNTERMINATED_COMMENT);
goto error; goto error;
} }
if ((ts->flags & TSF_NEWLINES) && lineno != ts->lineno) {
ts->flags &= ~TSF_DIRTYLINE;
tt = TOK_EOL;
goto eol_out;
}
ts->cursor = (ts->cursor - 1) & NTOKENS_MASK; ts->cursor = (ts->cursor - 1) & NTOKENS_MASK;
goto retry; goto retry;
} }