Repository navigation
fix(64883): fix asi before escaped keyword class members - #64885
Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused parser change and accompanying regression baselines have no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes #64883 in the native TypeScript parser by allowing automatic semicolon insertion before escaped keyword class members.
Changes:
- Stops binary-expression parsing before escaped keywords following a line break.
- Adds TypeScript and JavaScript regression cases, including unchanged operator behavior.
- Updates diagnostic, emit, symbol, and type baselines.
| File | Description |
|---|---|
tsc/testdata/tests/cases/conformance/scanner/ecmascript5/scannerUnicodeEscapeInKeyword2.ts |
Adds regression cases. |
tsc/testdata/baselines/reference/conformance/scannerUnicodeEscapeInKeyword2.types |
Records expected member types. |
tsc/testdata/baselines/reference/conformance/scannerUnicodeEscapeInKeyword2.symbols |
Records expected member symbols. |
tsc/testdata/baselines/reference/conformance/scannerUnicodeEscapeInKeyword2.js |
Records corrected emitted JavaScript. |
tsc/testdata/baselines/reference/conformance/scannerUnicodeEscapeInKeyword2.errors.txt |
Records expected diagnostics. |
tsc/internal/parser/parser.go |
Stops escaped keywords from continuing expressions across line breaks. |
Review effort: Balanced
Member
|
This appears to hang on this test: // @filename: g.ts
declare var x: any, y: any;
x
\u0069n
// @filename: h.ts
declare var x: any, y: any;
x
\u{69}nstanceof y
// @filename: i.ts
declare var x: any, y: any;
if (x
\u0069n y) {} |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #64883