Skip to content

gh pr checkout 63613 - Revert "Fix infinite loop"#63613

Closed
liu-idf18 wants to merge 1 commit into
microsoft:mainfrom
liu-idf18:revert-63581-fix-infinite-loop
Closed

gh pr checkout 63613 - Revert "Fix infinite loop"#63613
liu-idf18 wants to merge 1 commit into
microsoft:mainfrom
liu-idf18:revert-63581-fix-infinite-loop

Conversation

@liu-idf18

Copy link
Copy Markdown

TZAHAL 165

Reverts #63581

@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

1 similar comment
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Jul 5, 2026
@jakebailey jakebailey closed this Jul 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts the earlier “Fix infinite loop” change (#63581), affecting scanner identifier consumption logic and removing a unit test that covered a specific comment-parsing scenario.

Changes:

  • Reverted the identifier-scanning loop condition in createScanner (notably altering operator precedence).
  • Removed a unit test that asserted parsing succeeds for a /** ... */ block comment ending in -.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/testRunner/unittests/comments.ts Removes the test case covering /**comment-*/ parsing.
src/compiler/scanner.ts Reverts the identifier scanning while condition around CharacterCodes.minus.

Comment thread src/compiler/scanner.ts
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);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parentheses are easier to identify than the && operator. TypeScript was designed to make code easier for developers to read—hence the simple use of spacing and punctuation, and the goal of minimizing punctuation as much as possible.

@github-project-automation github-project-automation Bot moved this from Not started to Done in PR Backlog Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants