Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: should not parse as or satisfies expression for js #6427

Closed
Dunqing opened this issue Oct 10, 2024 · 2 comments · Fixed by #6442
Closed

parser: should not parse as or satisfies expression for js #6427

Dunqing opened this issue Oct 10, 2024 · 2 comments · Fixed by #6442
Assignees
Labels
A-parser Area - Parser C-bug Category - Bug

Comments

@Dunqing
Copy link
Member

Dunqing commented Oct 10, 2024

Please check out the Playground

a as any

The above code should throw an error if TS doesn't enable, because as is not a keyword in JavaScript

@Dunqing Dunqing added C-bug Category - Bug A-parser Area - Parser labels Oct 10, 2024
@Boshen Boshen self-assigned this Oct 10, 2024
@Boshen
Copy link
Member

Boshen commented Oct 10, 2024

Need a way to check this systematically 🤔

@Boshen
Copy link
Member

Boshen commented Oct 11, 2024

Found it: getJSSyntacticDiagnosticsForFile in TypeScript/src/compiler/program.ts

@Boshen Boshen changed the title parser: should not parse ts-only syntax if TS doesn't enable parser: should not parse as or satisfies expression for js Oct 11, 2024
@Dunqing Dunqing closed this as completed Oct 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area - Parser C-bug Category - Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants