Skip to content

Commit 132cd27

Browse files
committed
consistentlly compute the length of an unterminated multiline comment
1 parent 39046fa commit 132cd27

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/compiler/scanner.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,9 +676,8 @@ module ts {
676676
if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
677677
pos += 2;
678678

679-
var safeLength = len - 1; // For lookahead.
680679
var commentClosed = false;
681-
while (pos < safeLength) {
680+
while (pos < len) {
682681
var ch = text.charCodeAt(pos);
683682

684683
if (ch === CharacterCodes.asterisk && text.charCodeAt(pos + 1) === CharacterCodes.slash) {
@@ -694,7 +693,6 @@ module ts {
694693
}
695694

696695
if (!commentClosed) {
697-
pos++;
698696
error(Diagnostics.Asterisk_Slash_expected);
699697
}
700698

0 commit comments

Comments
 (0)