From 132cd276d14e25461379068d61225fef9f09e55d Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 7 Aug 2014 18:25:29 -0700 Subject: [PATCH] consistentlly compute the length of an unterminated multiline comment --- src/compiler/scanner.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 00966b12f2a..1db2f361f17 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -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); }