mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
consistentlly compute the length of an unterminated multiline comment
This commit is contained in:
parent
39046fa2d1
commit
132cd276d1
@ -676,9 +676,8 @@ module ts {
|
||||
if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
|
||||
pos += 2;
|
||||
|
||||
var safeLength = len - 1; // For lookahead.
|
||||
var commentClosed = false;
|
||||
while (pos < safeLength) {
|
||||
while (pos < len) {
|
||||
var ch = text.charCodeAt(pos);
|
||||
|
||||
if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) {
|
||||
@ -694,7 +693,6 @@ module ts {
|
||||
}
|
||||
|
||||
if (!commentClosed) {
|
||||
pos++;
|
||||
error(Diagnostics.Asterisk_Slash_expected);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user