gh pr checkout 63613 - Revert "Fix infinite loop"#63613
Conversation
This reverts commit 637d574.
|
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
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
There was a problem hiding this comment.
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. |
| 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); |
There was a problem hiding this comment.
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.
TZAHAL 165
Reverts #63581