Moved position increment in scanner; removed confusing comment.

This commit is contained in:
Daniel Rosenwasser
2014-12-02 13:56:02 -08:00
parent 4c4e5a43e0
commit 538f033f0d
+3 -3
View File
@@ -631,14 +631,14 @@ module ts {
// Speculated ECMAScript 6 Spec 11.8.6.1:
// <CR><LF> and <CR> LineTerminatorSequences are normalized to <LF> for Template Values
// An explicit EscapeSequence is needed to include a <CR> or <CR><LF> sequence.
if (currChar === CharacterCodes.carriageReturn) {
contents += text.substring(start, pos);
pos++;
if (pos + 1 < len && text.charCodeAt(pos + 1) === CharacterCodes.lineFeed) {
if (pos < len && text.charCodeAt(pos) === CharacterCodes.lineFeed) {
pos++;
}
pos++;
contents += "\n";
start = pos;
continue;