diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index c3ca7e121ad02..12d560a50301b 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -8703,9 +8703,9 @@ namespace Parser { function removeTrailingWhitespace(comments: string[]) { while (comments.length) { // TODO: Bad code is still bad; should operate on an entire string - const trimmed = comments[comments.length - 1].trim() + const trimmed = comments[comments.length - 1].trim(); if (trimmed === "") { - comments.pop() + comments.pop(); } else if (trimmed.length < comments[comments.length - 1].length) { comments[comments.length - 1] = comments[comments.length - 1].trimEnd(); @@ -8922,7 +8922,7 @@ namespace Parser { if (margin !== undefined && indent + whitespace.length > margin) { comments.push(whitespace.slice(margin - indent)); } - indent += whitespace.length; // TODO: What happens if we start saving comments here? We don't support margins like | * text text | do we? + indent += whitespace.length; // TODO: What happens if we start saving comments here? We don't support margins like | * text text | do we? } break; case SyntaxKind.OpenBraceToken: diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index 0e07ad19d749c..42ad6a078d4e5 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -2469,7 +2469,7 @@ export function createScanner(languageVersion: ScriptTarget, while (pos < end) { if (ch !== CharacterCodes.lineFeed && ch !== CharacterCodes.at && ch !== CharacterCodes.backtick && ch !== CharacterCodes.openBrace) { // TODO: We can also be smarter about openBrace, backtick and at by looking at a tiny amount of context - pos++ + pos++; } else { break;