From 40e71d9722fd17d115f0ab577a1b724556a80dfe Mon Sep 17 00:00:00 2001 From: liu-idf18 Date: Sun, 5 Jul 2026 15:40:21 -0300 Subject: [PATCH] Revert "Fix infinite loop (#63581)" This reverts commit 637d5746b70257028fb95aad32ddec6b26ab0a14. --- src/compiler/scanner.ts | 2 +- src/testRunner/unittests/comments.ts | 13 ------------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/compiler/scanner.ts b/src/compiler/scanner.ts index c4e20bb055e28..343df39ad9cbc 100644 --- a/src/compiler/scanner.ts +++ b/src/compiler/scanner.ts @@ -3915,7 +3915,7 @@ export function createScanner( if (isIdentifierStart(ch, languageVersion)) { let char = ch; - while (pos < end && (isIdentifierPart(char = codePointUnchecked(pos), languageVersion) || char === CharacterCodes.minus)) pos += charSize(char); + while (pos < end && isIdentifierPart(char = codePointUnchecked(pos), languageVersion) || char === CharacterCodes.minus) pos += charSize(char); tokenValue = text.substring(tokenStart, pos); if (char === CharacterCodes.backslash) { tokenValue += scanIdentifierParts(); diff --git a/src/testRunner/unittests/comments.ts b/src/testRunner/unittests/comments.ts index 0193826938b60..a1eeeb8aacfa1 100644 --- a/src/testRunner/unittests/comments.ts +++ b/src/testRunner/unittests/comments.ts @@ -11,7 +11,6 @@ describe("comment parsing", () => { const withTrailing = `;/* comment */ // another one `; - const endingInHyphen = "/**comment-*/"; it("skips shebang", () => { const result = ts.getLeadingCommentRanges(withShebang, 0); assert.isDefined(result); @@ -30,16 +29,4 @@ describe("comment parsing", () => { assert.strictEqual(result.length, 1); assert.strictEqual(result[0].kind, ts.SyntaxKind.SingleLineCommentTrivia); }); - - it("parses /** block comments ending in hyphen", () => { - const sourceFile = ts.createSourceFile( - "file.ts", - `${endingInHyphen}\nconst x = 1;`, - ts.ScriptTarget.ESNext, - /*setParentNodes*/ true, - ); - - assert.strictEqual(sourceFile.parseDiagnostics.length, 0); - assert.strictEqual(sourceFile.statements.length, 1); - }); });