Skip to content

Commit 40e71d9

Browse files
author
liu-idf18
authored
Revert "Fix infinite loop (#63581)"
This reverts commit 637d574.
1 parent 637d574 commit 40e71d9

2 files changed

Lines changed: 1 addition & 14 deletions

File tree

src/compiler/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3915,7 +3915,7 @@ export function createScanner(
39153915

39163916
if (isIdentifierStart(ch, languageVersion)) {
39173917
let char = ch;
3918-
while (pos < end && (isIdentifierPart(char = codePointUnchecked(pos), languageVersion) || char === CharacterCodes.minus)) pos += charSize(char);
3918+
while (pos < end && isIdentifierPart(char = codePointUnchecked(pos), languageVersion) || char === CharacterCodes.minus) pos += charSize(char);
39193919
tokenValue = text.substring(tokenStart, pos);
39203920
if (char === CharacterCodes.backslash) {
39213921
tokenValue += scanIdentifierParts();

src/testRunner/unittests/comments.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ describe("comment parsing", () => {
1111
const withTrailing = `;/* comment */
1212
// another one
1313
`;
14-
const endingInHyphen = "/**comment-*/";
1514
it("skips shebang", () => {
1615
const result = ts.getLeadingCommentRanges(withShebang, 0);
1716
assert.isDefined(result);
@@ -30,16 +29,4 @@ describe("comment parsing", () => {
3029
assert.strictEqual(result.length, 1);
3130
assert.strictEqual(result[0].kind, ts.SyntaxKind.SingleLineCommentTrivia);
3231
});
33-
34-
it("parses /** block comments ending in hyphen", () => {
35-
const sourceFile = ts.createSourceFile(
36-
"file.ts",
37-
`${endingInHyphen}\nconst x = 1;`,
38-
ts.ScriptTarget.ESNext,
39-
/*setParentNodes*/ true,
40-
);
41-
42-
assert.strictEqual(sourceFile.parseDiagnostics.length, 0);
43-
assert.strictEqual(sourceFile.statements.length, 1);
44-
});
4532
});

0 commit comments

Comments
 (0)