diff --git a/js/src/jsscan.cpp b/js/src/jsscan.cpp index f112a9a388a..513584fed34 100644 --- a/js/src/jsscan.cpp +++ b/js/src/jsscan.cpp @@ -1802,6 +1802,7 @@ skipline: } if (MatchChar(ts, '*')) { + uintN lineno = ts->lineno; while ((c = GetChar(ts)) != EOF && !(c == '*' && MatchChar(ts, '/'))) { /* Ignore all characters until comment close. */ @@ -1811,6 +1812,11 @@ skipline: JSMSG_UNTERMINATED_COMMENT); 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; goto retry; }