mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
consistentlly compute the length of an unterminated multiline comment
This commit is contained in:
1 parent
39046fa2d1
commit
132cd276d1
1 file changed
+1
-3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user