Skip to content

fix(64883): fix asi before escaped keyword class members - #64885

Open
Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
microsoft:mainfrom
a-tarasyuk:fix/64883
Open

Oleksandr Tarasiuk (a-tarasyuk) wants to merge 2 commits into
microsoft:mainfrom
a-tarasyuk:fix/64883

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #64883

Copilot AI balanced review requested due to automatic review settings October 20, 2026 13:19
@typescript-automation typescript-automation Bot added For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 20, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 20, 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.

🟢 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

@jakebailey

Copy link
Copy Markdown
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) {}

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.

🟢 Approval recommended

The focused parser change and regression baselines support the intended behavior, with no blocking issues identified.

No open issues 🎉

Review effort: Balanced

This branch has not been deployed

No deployments
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: Not started

Development

Successfully merging this pull request may close these issues.

Escaped in / instanceof after a class field initializer is parsed as a binary operator instead of a new member

3 participants