Conversation
export enum and similar ts syntaxes`export enum and similar ts syntaxes
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the parser to properly handle TypeScript-specific syntax like export enum, export interface, and similar constructs by adding TypeScript context checks and reorganizing the declaration parsing logic.
- Moves variable declaration parsing to handle
var,let, andconstfirst - Adds
self.is_tschecks to TypeScript-specific declaration types to prevent parsing them in JavaScript contexts - Removes the unused
is_variable_declaration()helper method
Reviewed Changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_parser/src/ts/statement.rs | Reorganizes declaration parsing logic and adds TypeScript context checks |
| crates/oxc_parser/src/lexer/kind.rs | Removes unused is_variable_declaration() helper method |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
CodSpeed Instrumentation Performance ReportMerging #13208 will not alter performanceComparing Summary
Footnotes |
fixes #13205
closes #13206